home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_fnlib.idb / usr / freeware / src / fnlib / patches.z / patches
Encoding:
Text File  |  1999-07-16  |  234.7 KB  |  7,493 lines

  1. --- ./ltmain.sh    Mon Dec 14 14:52:56 1998
  2. +++ ../fnlib-0.4/./ltmain.sh    Thu Apr 15 16:05:56 1999
  3. @@ -1,6 +1,7 @@
  4.  # ltmain.sh - Provide generalized library-building support services.
  5. -# Generated automatically from ltmain.in by configure.
  6. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
  7. +# NOTE: Changing this file will not affect anything until you rerun ltconfig.
  8. +#
  9. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  10.  # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  11.  #
  12.  # This program is free software; you can redistribute it and/or modify
  13. @@ -22,6 +23,25 @@
  14.  # configuration script generated by Autoconf, you may include it under
  15.  # the same distribution terms that you use for the rest of that program.
  16.  
  17. +# Check that we have a working $echo.
  18. +if test "X$1" = X--no-reexec; then
  19. +  # Discard the --no-reexec flag, and continue.
  20. +  shift
  21. +elif test "X$1" = X--fallback-echo; then
  22. +  # used as fallback echo
  23. +  shift
  24. +  cat <<EOF
  25. +$*
  26. +EOF
  27. +  exit 0
  28. +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  29. +  # Yippee, $echo works!
  30. +  :
  31. +else
  32. +  # Restart under the correct shell, and then maybe $echo will work.
  33. +  exec $SHELL "$0" --no-reexec ${1+"$@"}
  34. +fi
  35. +
  36.  # The name of this program.
  37.  progname=`$echo "$0" | sed 's%^.*/%%'`
  38.  modename="$progname"
  39. @@ -29,7 +49,8 @@
  40.  # Constants.
  41.  PROGRAM=ltmain.sh
  42.  PACKAGE=libtool
  43. -VERSION=1.0h
  44. +VERSION=1.2f
  45. +TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
  46.  
  47.  default_mode=
  48.  help="Try \`$progname --help' for more information."
  49. @@ -40,14 +61,22 @@
  50.  
  51.  # Sed substitution that helps us do robust quoting.  It backslashifies
  52.  # metacharacters that are still active within double-quoted strings.
  53. +Xsed='sed -e 1s/^X//'
  54.  sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
  55. +SP2NL='tr \040 \012'
  56. +NL2SP='tr \012 \040'
  57.  
  58.  # NLS nuisances.
  59.  # Only set LANG and LC_ALL to C if already set.
  60.  # These must not be set unconditionally because not all systems understand
  61.  # e.g. LANG=C (notably SCO).
  62. -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  63. -if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  64. +# We save the old values to restore during execute mode.
  65. +if test "${LC_ALL+set}" = set; then
  66. +  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
  67. +fi
  68. +if test "${LANG+set}" = set; then
  69. +  save_LANG="$LANG"; LANG=C; export LANG
  70. +fi
  71.  
  72.  if test "$LTCONFIG_VERSION" != "$VERSION"; then
  73.    echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
  74. @@ -70,6 +99,7 @@
  75.  show="$echo"
  76.  show_help=
  77.  execute_dlfiles=
  78. +lo2o="s/\\.lo\$/.${objext}/"
  79.  
  80.  # Parse our command line options once, thoroughly.
  81.  while test $# -gt 0
  82. @@ -78,7 +108,7 @@
  83.    shift
  84.  
  85.    case "$arg" in
  86. -  -*=*) optarg=`$echo "$arg" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  87. +  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
  88.    *) optarg= ;;
  89.    esac
  90.  
  91. @@ -105,10 +135,20 @@
  92.      ;;
  93.  
  94.    --version)
  95. -    echo "$PROGRAM (GNU $PACKAGE) $VERSION"
  96. +    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
  97. +    exit 0
  98. +    ;;
  99. +
  100. +  --config)
  101. +    sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0
  102.      exit 0
  103.      ;;
  104.  
  105. +  --debug)
  106. +    echo "$progname: enabling shell trace mode"
  107. +    set -x
  108. +    ;;
  109. +
  110.    --dry-run | -n)
  111.      run=:
  112.      ;;
  113. @@ -166,22 +206,22 @@
  114.    # Infer the operation mode.
  115.    if test -z "$mode"; then
  116.      case "$nonopt" in
  117. -    *cc | *++)
  118. +    *cc | *++ | gcc* | *-gcc*)
  119.        mode=link
  120.        for arg
  121.        do
  122. -        case "$arg" in
  123. -        -c)
  124. -           mode=compile
  125. -           break
  126. -           ;;
  127. -        esac
  128. +    case "$arg" in
  129. +    -c)
  130. +       mode=compile
  131. +       break
  132. +       ;;
  133. +    esac
  134.        done
  135.        ;;
  136. -    *db | *dbx)
  137. +    *db | *dbx | *strace | *truss)
  138.        mode=execute
  139.        ;;
  140. -    *install*|cp)
  141. +    *install*|cp|mv)
  142.        mode=install
  143.        ;;
  144.      *rm)
  145. @@ -193,11 +233,11 @@
  146.  
  147.        # Just use the default operation mode.
  148.        if test -z "$mode"; then
  149. -        if test -n "$nonopt"; then
  150. -          $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  151. -        else
  152. -          $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  153. -        fi
  154. +    if test -n "$nonopt"; then
  155. +      $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
  156. +    else
  157. +      $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
  158. +    fi
  159.        fi
  160.        ;;
  161.      esac
  162. @@ -225,14 +265,38 @@
  163.      srcfile="$nonopt"
  164.      suppress_output=
  165.  
  166. +    user_target=no
  167.      for arg
  168.      do
  169. -      # The only flag that cannot be specified is the output filename.
  170. -      if test "X$arg" = "X-o"; then
  171. -    $echo "$modename: you cannot specify the output filename with \`-o'" 1>&2
  172. -    $echo "$help" 1>&2
  173. -    exit 1
  174. -      fi
  175. +      # Accept any command-line options.
  176. +      case "$arg" in
  177. +      -o)
  178. +    if test "$user_target" != "no"; then
  179. +      $echo "$modename: you cannot specify \`-o' more than once" 1>&2
  180. +      exit 1
  181. +    fi
  182. +    user_target=next
  183. +    ;;
  184. +
  185. +      -static)
  186. +    build_old_libs=yes
  187. +    continue
  188. +    ;;
  189. +      esac
  190. +
  191. +      case "$user_target" in
  192. +      next)
  193. +    # The next one is the -o target name
  194. +    user_target=yes
  195. +    continue
  196. +    ;;
  197. +      yes)
  198. +    # We got the output file
  199. +    user_target=set
  200. +    libobj="$arg"
  201. +    continue
  202. +    ;;
  203. +      esac
  204.  
  205.        # Accept the current argument as the source file.
  206.        lastarg="$srcfile"
  207. @@ -243,7 +307,7 @@
  208.        # Backslashify any backslashes, double quotes, and dollar signs.
  209.        # These are the only characters that are still specially
  210.        # interpreted inside of double-quoted scrings.
  211. -      lastarg=`$echo "$lastarg" | sed "$sed_quote_subst"`
  212. +      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
  213.  
  214.        # Double-quote args containing other shell metacharacters.
  215.        # Many Bourne shells cannot handle close brackets correctly in scan
  216. @@ -262,12 +326,27 @@
  217.        fi
  218.      done
  219.  
  220. -    # Get the name of the library object.
  221. -    libobj=`$echo "$srcfile" | sed -e 's%^.*/%%'`
  222. +    case "$user_target" in
  223. +    set)
  224. +      ;;
  225. +    no)
  226. +      # Get the name of the library object.
  227. +      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
  228. +      ;;
  229. +    *)
  230. +      $echo "$modename: you must specify a target with \`-o'" 1>&2
  231. +      exit 1
  232. +      ;;
  233. +    esac
  234.  
  235.      # Recognize several different file suffixes.
  236. -    xform='[cCFSfm]'
  237. +    # If the user specifies -o file.o, it is replaced with file.lo
  238. +    xform='[cCFSfmso]'
  239.      case "$libobj" in
  240. +    *.ada) xform=ada ;;
  241. +    *.adb) xform=adb ;;
  242. +    *.ads) xform=ads ;;
  243. +    *.asm) xform=asm ;;
  244.      *.c++) xform=c++ ;;
  245.      *.cc) xform=cc ;;
  246.      *.cpp) xform=cpp ;;
  247. @@ -276,12 +355,12 @@
  248.      *.for) xform=for ;;
  249.      esac
  250.  
  251. -    libobj=`$echo "$libobj" | sed -e "s/\.$xform$/.lo/"`
  252. +    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
  253.  
  254.      case "$libobj" in
  255. -    *.lo) obj=`$echo "$libobj" | sed -e 's/\.lo$/.o/'` ;;
  256. +    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
  257.      *)
  258. -      $echo "$modename: cannot determine name of library object from \`$srcfile'" 1>&2
  259. +      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
  260.        exit 1
  261.        ;;
  262.      esac
  263. @@ -294,11 +373,54 @@
  264.  
  265.      # Delete any leftover library objects.
  266.      if test "$build_old_libs" = yes; then
  267. -      $run $rm $obj $libobj
  268. -      trap "$run $rm $obj $libobj; exit 1" 1 2 15
  269. +      removelist="$obj $libobj"
  270. +    else
  271. +      removelist="$libobj"
  272. +    fi
  273. +
  274. +    $run $rm $removelist
  275. +    trap "$run $rm $removelist; exit 1" 1 2 15
  276. +
  277. +    # Calculate the filename of the output object if compiler does
  278. +    # not support -o with -c
  279. +    if test "$compiler_c_o" = no; then
  280. +      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext}
  281. +      lockfile="$output_obj.lock"
  282. +      removelist="$removelist $output_obj $lockfile"
  283. +      trap "$run $rm $removelist; exit 1" 1 2 15
  284.      else
  285. -      $run $rm $libobj
  286. -      trap "$run $rm $libobj; exit 1" 1 2 15
  287. +      need_locks=no
  288. +      lockfile=
  289. +    fi
  290. +
  291. +    # Lock this critical section if it is needed
  292. +    # We use this script file to make the link, it avoids creating a new file
  293. +    if test "$need_locks" = yes; then
  294. +      until ln "$0" "$lockfile" 2>/dev/null; do
  295. +    $show "Waiting for $lockfile to be removed"
  296. +    sleep 2
  297. +      done
  298. +    elif test "$need_locks" = warn; then
  299. +      if test -f "$lockfile"; then
  300. +    echo "\
  301. +*** ERROR, $lockfile exists and contains:
  302. +`cat $lockfile 2>/dev/null`
  303. +
  304. +This indicates that another process is trying to use the same
  305. +temporary object file, and libtool could not work around it because
  306. +your compiler does not support \`-c' and \`-o' together.  If you
  307. +repeat this compilation, it may succeed, by chance, but you had better
  308. +avoid parallel builds (make -j) in this platform, or get a better
  309. +compiler."
  310. +
  311. +    $run $rm $removelist
  312. +    exit 1
  313. +      fi
  314. +      echo $srcfile > "$lockfile"
  315. +    fi
  316. +
  317. +    if test -n "$fix_srcfile_path"; then
  318. +      eval srcfile=\"$fix_srcfile_path\"
  319.      fi
  320.  
  321.      # Only build a PIC object if we are building libtool libraries.
  322. @@ -307,23 +429,101 @@
  323.        fbsd_hideous_sh_bug=$base_compile
  324.  
  325.        # All platforms use -DPIC, to notify preprocessed assembler code.
  326. -      $show "$base_compile$pic_flag -DPIC $srcfile"
  327. -      if $run eval "$base_compile\$pic_flag -DPIC \$srcfile"; then :
  328. +      command="$base_compile $pic_flag -DPIC $srcfile"
  329. +      if test "$build_old_libs" = yes; then
  330. +    lo_libobj="$libobj"
  331. +    dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
  332. +    if test "X$dir" = "X$libobj"; then
  333. +      dir="$objdir"
  334. +    else
  335. +      dir="$dir/$objdir"
  336. +    fi
  337. +    libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
  338. +
  339. +    if test -d "$dir"; then
  340. +      $show "$rm $libobj"
  341. +      $run $rm $libobj
  342. +    else
  343. +      $show "$mkdir $dir"
  344. +      $run $mkdir $dir
  345. +      status=$?
  346. +      if test $status -ne 0 && test ! -d $dir; then
  347. +        exit $status
  348. +      fi
  349. +    fi
  350. +      fi
  351. +      if test "$compiler_o_lo" = yes; then
  352. +    output_obj="$libobj"
  353. +    command="$command -o $output_obj"
  354. +      elif test "$compiler_c_o" = yes; then
  355. +    output_obj="$obj"
  356. +    command="$command -o $output_obj"
  357. +      fi
  358. +
  359. +      $show "$command"
  360. +      if $run eval "$command"; then :
  361.        else
  362. -        test -n "$obj" && $run $rm $obj
  363. -        exit 1
  364. +    test -n "$output_obj" && $run $rm $removelist
  365. +    exit 1
  366.        fi
  367.  
  368. -      # If we have no pic_flag, then copy the object into place and finish.
  369. -      if test -z "$pic_flag"; then
  370. -        $show "$LN_S $obj $libobj"
  371. -        $run $LN_S $obj $libobj
  372. -        exit $?
  373. +      if test "$need_locks" = warn &&
  374. +     test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  375. +    echo "\
  376. +*** ERROR, $lockfile contains:
  377. +`cat $lockfile 2>/dev/null`
  378. +
  379. +but it should contain:
  380. +$srcfile
  381. +
  382. +This indicates that another process is trying to use the same
  383. +temporary object file, and libtool could not work around it because
  384. +your compiler does not support \`-c' and \`-o' together.  If you
  385. +repeat this compilation, it may succeed, by chance, but you had better
  386. +avoid parallel builds (make -j) in this platform, or get a better
  387. +compiler."
  388. +
  389. +    $run $rm $removelist
  390. +    exit 1
  391.        fi
  392.  
  393. -      # Just move the object, then go on to compile the next one
  394. -      $show "$mv $obj $libobj"
  395. -      $run $mv $obj $libobj || exit 1
  396. +      # Just move the object if needed, then go on to compile the next one
  397. +      if test x"$output_obj" != x"$libobj"; then
  398. +    $show "$mv $output_obj $libobj"
  399. +    if $run $mv $output_obj $libobj; then :
  400. +    else
  401. +      error=$?
  402. +      $run $rm $removelist
  403. +      exit $error
  404. +    fi
  405. +      fi
  406. +
  407. +      # If we have no pic_flag, then copy the object into place and finish.
  408. +      if test -z "$pic_flag" && test "$build_old_libs" = yes; then
  409. +    # Rename the .lo from within objdir to obj
  410. +    if test -f $obj; then
  411. +      $show $rm $obj
  412. +      $run $rm $obj
  413. +    fi
  414. +
  415. +    $show "$mv $libobj $obj"
  416. +    if $run $mv $libobj $obj; then :
  417. +    else
  418. +      error=$?
  419. +      $run $rm $removelist
  420. +      exit $error
  421. +    fi
  422. +
  423. +    # Now arrange that obj and lo_libobj become the same file
  424. +    $show "$LN_S $obj $lo_libobj"
  425. +    if $run $LN_S $obj $lo_libobj; then
  426. +      exit 0
  427. +    else
  428. +      error=$?
  429. +      $run $rm $removelist
  430. +      exit $error
  431. +    fi
  432. +      fi
  433.  
  434.        # Allow error messages only from the first compilation.
  435.        suppress_output=' >/dev/null 2>&1'
  436. @@ -331,20 +531,72 @@
  437.  
  438.      # Only build a position-dependent object if we build old libraries.
  439.      if test "$build_old_libs" = yes; then
  440. +      command="$base_compile $srcfile"
  441. +      if test "$compiler_c_o" = yes; then
  442. +    command="$command -o $obj"
  443. +    output_obj="$obj"
  444. +      fi
  445. +
  446.        # Suppress compiler output if we already did a PIC compilation.
  447. -      $show "$base_compile $srcfile$suppress_output"
  448. -      if $run eval "$base_compile \$srcfile$suppress_output"; then :
  449. +      command="$command$suppress_output"
  450. +      $show "$command"
  451. +      if $run eval "$command"; then :
  452.        else
  453. -        $run $rm $obj $libobj
  454. -        exit 1
  455. +    $run $rm $removelist
  456. +    exit 1
  457. +      fi
  458. +
  459. +      if test "$need_locks" = warn &&
  460. +     test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
  461. +    echo "\
  462. +*** ERROR, $lockfile contains:
  463. +`cat $lockfile 2>/dev/null`
  464. +
  465. +but it should contain:
  466. +$srcfile
  467. +
  468. +This indicates that another process is trying to use the same
  469. +temporary object file, and libtool could not work around it because
  470. +your compiler does not support \`-c' and \`-o' together.  If you
  471. +repeat this compilation, it may succeed, by chance, but you had better
  472. +avoid parallel builds (make -j) in this platform, or get a better
  473. +compiler."
  474. +
  475. +    $run $rm $removelist
  476. +    exit 1
  477. +      fi
  478. +
  479. +      # Just move the object if needed
  480. +      if test x"$output_obj" != x"$obj"; then
  481. +    $show "$mv $output_obj $obj"
  482. +    if $run $mv $output_obj $obj; then :
  483. +    else
  484. +      error=$?
  485. +      $run $rm $removelist
  486. +      exit $error
  487. +    fi
  488. +      fi
  489. +
  490. +      # Create an invalid libtool object if no PIC, so that we do not
  491. +      # accidentally link it into a program.
  492. +      if test "$build_libtool_libs" != yes; then
  493. +    $show "echo timestamp > $libobj"
  494. +    $run eval "echo timestamp > \$libobj" || exit $?
  495. +      else
  496. +    # Move the .lo from within objdir
  497. +    $show "$mv $libobj $lo_libobj"
  498. +    if $run $mv $libobj $lo_libobj; then :
  499. +    else
  500. +      error=$?
  501. +      $run $rm $removelist
  502. +      exit $error
  503. +    fi
  504.        fi
  505.      fi
  506.  
  507. -    # Create an invalid libtool object if no PIC, so that we don't accidentally
  508. -    # link it into a program.
  509. -    if test "$build_libtool_libs" != yes; then
  510. -      $show "echo timestamp > $libobj"
  511. -      $run eval "echo timestamp > \$libobj" || exit $?
  512. +    # Unlock the critical section if it was locked
  513. +    if test "$need_locks" != no; then
  514. +      $rm "$lockfile"
  515.      fi
  516.  
  517.      exit 0
  518. @@ -353,27 +605,225 @@
  519.    # libtool link mode
  520.    link)
  521.      modename="$modename: link"
  522. +    C_compiler="$CC" # save it, to compile generated C sources
  523.      CC="$nonopt"
  524. -    allow_undefined=yes
  525. +    case "$host" in
  526. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  527. +      # It is impossible to link a dll without this setting, and
  528. +      # we shouldn't force the makefile maintainer to figure out
  529. +      # which system we are compiling for in order to pass an extra
  530. +      # flag for every libtool invokation.
  531. +      # allow_undefined=no
  532. +
  533. +      # FIXME: Unfortunately, there are problems with the above when trying
  534. +      # to make a dll which has undefined symbols, in which case not
  535. +      # even a static library is built.  For now, we need to specify
  536. +      # -no-undefined on the libtool link line when we can be certain
  537. +      # that all symbols are satisfied, otherwise we get a static library.
  538. +      allow_undefined=yes
  539. +
  540. +      # This is a source program that is used to create dlls on Windows
  541. +      # Don't remove nor modify the starting and closing comments
  542. +# /* ltdll.c starts here */
  543. +# #define WIN32_LEAN_AND_MEAN
  544. +# #include <windows.h>
  545. +# #undef WIN32_LEAN_AND_MEAN
  546. +# #include <stdio.h>
  547. +#
  548. +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
  549. +#
  550. +# #include <cygwin/cygwin_dll.h>
  551. +# DECLARE_CYGWIN_DLL( DllMain );
  552. +# HINSTANCE __hDllInstance_base;
  553. +#
  554. +# BOOL APIENTRY
  555. +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
  556. +# {
  557. +#   __hDllInstance_base = hInst;
  558. +#   return TRUE;
  559. +# }
  560. +# /* ltdll.c ends here */
  561. +      # This is a source program that is used to create import libraries
  562. +      # on Windows for dlls which lack them. Don't remove nor modify the
  563. +      # starting and closing comments
  564. +# /* impgen.c starts here */
  565. +# /*   Copyright (C) 1999 Free Software Foundation, Inc.
  566. +# 
  567. +#  This file is part of GNU libtool.
  568. +# 
  569. +#  This program is free software; you can redistribute it and/or modify
  570. +#  it under the terms of the GNU General Public License as published by
  571. +#  the Free Software Foundation; either version 2 of the License, or
  572. +#  (at your option) any later version.
  573. +# 
  574. +#  This program is distributed in the hope that it will be useful,
  575. +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
  576. +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  577. +#  GNU General Public License for more details.
  578. +# 
  579. +#  You should have received a copy of the GNU General Public License
  580. +#  along with this program; if not, write to the Free Software
  581. +#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  582. +#  */
  583. +# 
  584. +#  #include <stdio.h>        /* for printf() */
  585. +#  #include <unistd.h>        /* for open(), lseek(), read() */
  586. +#  #include <fcntl.h>        /* for O_RDONLY, O_BINARY */
  587. +#  #include <string.h>        /* for strdup() */
  588. +# 
  589. +#  static unsigned int
  590. +#  pe_get16 (fd, offset)
  591. +#       int fd;
  592. +#       int offset;
  593. +#  {
  594. +#    unsigned char b[2];
  595. +#    lseek (fd, offset, SEEK_SET);
  596. +#    read (fd, b, 2);
  597. +#    return b[0] + (b[1]<<8);
  598. +#  }
  599. +# 
  600. +#  static unsigned int
  601. +#  pe_get32 (fd, offset)
  602. +#      int fd;
  603. +#      int offset;
  604. +#  {
  605. +#    unsigned char b[4];
  606. +#    lseek (fd, offset, SEEK_SET);
  607. +#    read (fd, b, 4);
  608. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  609. +#  }
  610. +# 
  611. +#  static unsigned int
  612. +#  pe_as32 (ptr)
  613. +#       void *ptr;
  614. +#  {
  615. +#    unsigned char *b = ptr;
  616. +#    return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
  617. +#  }
  618. +# 
  619. +#  int
  620. +#  main (argc, argv)
  621. +#      int argc;
  622. +#      char *argv[];
  623. +#  {
  624. +#      int dll;
  625. +#      unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
  626. +#      unsigned long export_rva, export_size, nsections, secptr, expptr;
  627. +#      unsigned long name_rvas, nexp;
  628. +#      unsigned char *expdata, *erva;
  629. +#      char *filename, *dll_name;
  630. +# 
  631. +#      filename = argv[1];
  632. +# 
  633. +#      dll = open(filename, O_RDONLY|O_BINARY);
  634. +#      if (!dll)
  635. +#      return 1;
  636. +# 
  637. +#      dll_name = filename;
  638. +#    
  639. +#      for (i=0; filename[i]; i++)
  640. +#      if (filename[i] == '/' || filename[i] == '\\'  || filename[i] == ':')
  641. +#          dll_name = filename + i +1;
  642. +# 
  643. +#      pe_header_offset = pe_get32 (dll, 0x3c);
  644. +#      opthdr_ofs = pe_header_offset + 4 + 20;
  645. +#      num_entries = pe_get32 (dll, opthdr_ofs + 92);
  646. +# 
  647. +#      if (num_entries < 1) /* no exports */
  648. +#      return 1;
  649. +# 
  650. +#      export_rva = pe_get32 (dll, opthdr_ofs + 96);
  651. +#      export_size = pe_get32 (dll, opthdr_ofs + 100);
  652. +#      nsections = pe_get16 (dll, pe_header_offset + 4 +2);
  653. +#      secptr = (pe_header_offset + 4 + 20 +
  654. +#            pe_get16 (dll, pe_header_offset + 4 + 16));
  655. +# 
  656. +#      expptr = 0;
  657. +#      for (i = 0; i < nsections; i++)
  658. +#      {
  659. +#      char sname[8];
  660. +#      unsigned long secptr1 = secptr + 40 * i;
  661. +#      unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
  662. +#      unsigned long vsize = pe_get32 (dll, secptr1 + 16);
  663. +#      unsigned long fptr = pe_get32 (dll, secptr1 + 20);
  664. +#      lseek(dll, secptr1, SEEK_SET);
  665. +#      read(dll, sname, 8);
  666. +#      if (vaddr <= export_rva && vaddr+vsize > export_rva)
  667. +#      {
  668. +#          expptr = fptr + (export_rva - vaddr);
  669. +#          if (export_rva + export_size > vaddr + vsize)
  670. +#          export_size = vsize - (export_rva - vaddr);
  671. +#          break;
  672. +#      }
  673. +#      }
  674. +# 
  675. +#      expdata = (unsigned char*)malloc(export_size);
  676. +#      lseek (dll, expptr, SEEK_SET);
  677. +#      read (dll, expdata, export_size);
  678. +#      erva = expdata - export_rva;
  679. +# 
  680. +#      nexp = pe_as32 (expdata+24);
  681. +#      name_rvas = pe_as32 (expdata+32);
  682. +# 
  683. +#      printf ("EXPORTS\n");
  684. +#      for (i = 0; i<nexp; i++)
  685. +#      {
  686. +#      unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
  687. +#      printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
  688. +#      }
  689. +# 
  690. +#      return 0;
  691. +#  }
  692. +# /* impgen.c ends here */
  693. +      ;;
  694. +    *)
  695. +      allow_undefined=yes
  696. +      ;;
  697. +    esac
  698.      compile_command="$CC"
  699.      finalize_command="$CC"
  700.  
  701. +    compile_rpath=
  702. +    finalize_rpath=
  703.      compile_shlibpath=
  704.      finalize_shlibpath=
  705. +    convenience=
  706. +    old_convenience=
  707.      deplibs=
  708. +    linkopts=
  709. +
  710. +    if test -n "$shlibpath_var"; then
  711. +      # get the directories listed in $shlibpath_var
  712. +      eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
  713. +    else
  714. +      lib_search_path=
  715. +    fi
  716. +    # now prepend the system-specific ones
  717. +    eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\"
  718. +    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
  719. +    
  720. +    avoid_version=no
  721.      dlfiles=
  722.      dlprefiles=
  723. +    dlself=no
  724.      export_dynamic=no
  725. -    hardcode_libdirs=
  726. +    export_symbols=
  727. +    export_symbols_regex=
  728. +    generated=
  729.      libobjs=
  730.      link_against_libtool_libs=
  731.      ltlibs=
  732. +    module=no
  733.      objs=
  734. +    preload=no
  735.      prev=
  736.      prevarg=
  737. +    release=
  738.      rpath=
  739. +    xrpath=
  740.      perm_rpath=
  741.      temp_rpath=
  742. +    thread_safe=no
  743.      vinfo=
  744.  
  745.      # We need to know -static, to get the right output filenames.
  746. @@ -381,13 +831,13 @@
  747.      do
  748.        case "$arg" in
  749.        -all-static | -static)
  750. -        if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  751. +    if test "X$arg" = "X-all-static" && test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
  752.          $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
  753. -        fi
  754. -        build_libtool_libs=no
  755. +    fi
  756. +    build_libtool_libs=no
  757.      build_old_libs=yes
  758. -        break
  759. -        ;;
  760. +    break
  761. +    ;;
  762.        esac
  763.      done
  764.  
  765. @@ -395,39 +845,80 @@
  766.      test -n "$old_archive_from_new_cmds" && build_old_libs=yes
  767.  
  768.      # Go through the arguments, transforming them on the way.
  769. -    for arg
  770. -    do
  771. +    while test $# -gt 0; do
  772. +      arg="$1"
  773. +      shift
  774. +
  775.        # If the previous option needs an argument, assign it.
  776.        if test -n "$prev"; then
  777. -        case "$prev" in
  778. -        output)
  779. -          compile_command="$compile_command @OUTPUT@"
  780. -          finalize_command="$finalize_command @OUTPUT@"
  781. -          ;;
  782. -        esac
  783. -
  784. -        case "$prev" in
  785. -        dlfiles|dlprefiles)
  786. -          case "$arg" in
  787. -          *.la | *.lo) ;;  # We handle these cases below.
  788. -          *)
  789. -            dlprefiles="$dlprefiles $arg"
  790. -            test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  791. -            prev=
  792. -            ;;
  793. -          esac
  794. -          ;;
  795. -        rpath)
  796. -          rpath="$rpath $arg"
  797. +    case "$prev" in
  798. +    output)
  799. +      compile_command="$compile_command @OUTPUT@"
  800. +      finalize_command="$finalize_command @OUTPUT@"
  801. +      ;;
  802. +    esac
  803. +
  804. +    case "$prev" in
  805. +    dlfiles|dlprefiles)
  806. +      if test "$preload" = no; then
  807. +        # Add the symbol object into the linking commands.
  808. +        compile_command="$compile_command @SYMFILE@"
  809. +        finalize_command="$finalize_command @SYMFILE@"
  810. +        preload=yes
  811. +      fi
  812. +      case "$arg" in
  813. +      *.la | *.lo) ;;  # We handle these cases below.
  814. +      self)
  815. +        if test "$prev" = dlprefiles; then
  816. +          dlself=yes
  817. +        elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
  818. +          dlself=yes
  819. +        fi
  820. +        prev=
  821. +        continue
  822. +        ;;
  823. +      *)
  824. +        dlprefiles="$dlprefiles $arg"
  825. +        test "$prev" = dlfiles && dlfiles="$dlfiles $arg"
  826. +        prev=
  827. +        ;;
  828. +      esac
  829. +      ;;
  830. +    expsyms)
  831. +      export_symbols="$arg"
  832. +      if test ! -f "$arg"; then
  833. +        $echo "$modename: symbol file \`$arg' does not exist"
  834. +        exit 1
  835. +      fi
  836.        prev=
  837.        continue
  838.        ;;
  839. -        *)
  840. -          eval "$prev=\"\$arg\""
  841. -          prev=
  842. -          continue
  843. -          ;;
  844. -        esac
  845. +    expsyms_regex)
  846. +      export_symbols_regex="$arg"
  847. +      prev=
  848. +      continue
  849. +      ;;
  850. +    release)
  851. +      release="-$arg"
  852. +      prev=
  853. +      continue
  854. +      ;;
  855. +    rpath)
  856. +      rpath="$rpath $arg"
  857. +      prev=
  858. +      continue
  859. +      ;;
  860. +    xrpath)
  861. +      xrpath="$xrpath $arg"
  862. +      prev=
  863. +      continue
  864. +      ;;
  865. +    *)
  866. +      eval "$prev=\"\$arg\""
  867. +      prev=
  868. +      continue
  869. +      ;;
  870. +    esac
  871.        fi
  872.  
  873.        prevarg="$arg"
  874. @@ -435,10 +926,11 @@
  875.        case "$arg" in
  876.        -all-static)
  877.      if test -n "$link_static_flag"; then
  878. -          compile_command="$compile_command $link_static_flag"
  879. +      compile_command="$compile_command $link_static_flag"
  880.        finalize_command="$finalize_command $link_static_flag"
  881. -        fi
  882. -        continue
  883. +      dlopen_self=$dlopen_self_static
  884. +    fi
  885. +    continue
  886.      ;;
  887.  
  888.        -allow-undefined)
  889. @@ -447,47 +939,91 @@
  890.      continue
  891.      ;;
  892.  
  893. +      -avoid-version)
  894. +    avoid_version=yes
  895. +    continue
  896. +    ;;
  897. +
  898.        -dlopen)
  899. -        prev=dlfiles
  900. -        continue
  901. -        ;;
  902. +    prev=dlfiles
  903. +    continue
  904. +    ;;
  905.  
  906.        -dlpreopen)
  907. -        prev=dlprefiles
  908. -        continue
  909. -        ;;
  910. +    prev=dlprefiles
  911. +    continue
  912. +    ;;
  913.  
  914.        -export-dynamic)
  915. -        if test "$export_dynamic" != yes; then
  916. -          export_dynamic=yes
  917. +    if test "$export_dynamic" != yes; then
  918. +      export_dynamic=yes
  919.        if test -n "$export_dynamic_flag_spec"; then
  920. -        arg=`eval \\$echo "$export_dynamic_flag_spec"`
  921. +        eval arg=\"$export_dynamic_flag_spec\"
  922.        else
  923.          arg=
  924.        fi
  925. +    fi
  926. +    ;;
  927.  
  928. -          # Add the symbol object into the linking commands.
  929. -      compile_command="$compile_command @SYMFILE@"
  930. -      finalize_command="$finalize_command @SYMFILE@"
  931. -        fi
  932. -        ;;
  933. +      -export-symbols | -export-symbols-regex)
  934. +    if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
  935. +      $echo "$modename: cannot have more than one -exported-symbols"
  936. +      exit 1
  937. +    fi
  938. +    if test "$arg" = "-export-symbols"; then
  939. +      prev=expsyms
  940. +    else
  941. +      prev=expsyms_regex
  942. +    fi
  943. +    continue
  944. +    ;;
  945.  
  946.        -L*)
  947. -        dir=`$echo "$arg" | sed 's%^-L\(.*\)$%\1%'`
  948. -        case "$dir" in
  949. -        /*)
  950. +    dir=`$echo "X$arg" | $Xsed -e 's%^-L\(.*\)$%\1%'`
  951. +    case "$dir" in
  952. +    /* | [A-Za-z]:[/\\]*)
  953.        # Add the corresponding hardcode_libdir_flag, if it is not identical.
  954. -          ;;
  955. -        *)
  956. -          $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
  957. -          exit 1
  958. -          ;;
  959. -        esac
  960. -        deplibs="$deplibs $arg"
  961. -        ;;
  962. +      ;;
  963. +    *)
  964. +      $echo "$modename: \`-L$dir' cannot specify a relative directory" 1>&2
  965. +      exit 1
  966. +      ;;
  967. +    esac
  968. +    case " $deplibs " in
  969. +    *" $arg "*) ;;
  970. +    *) deplibs="$deplibs $arg";;
  971. +    esac
  972. +    case " $lib_search_path " in
  973. +    *" $dir "*) ;;
  974. +    *) lib_search_path="$lib_search_path $dir";;
  975. +    esac
  976. +    case "$host" in
  977. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  978. +      dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  979. +      case ":$dllsearchpath:" in
  980. +      ::) dllsearchpath="$dllsearchdir";;
  981. +      *":$dllsearchdir:"*) ;;
  982. +      *) dllsearchpath="$dllsearchpath:$dllsearchdir";;
  983. +      esac
  984. +      ;;
  985. +    esac
  986. +    ;;
  987.  
  988. -      -l*) deplibs="$deplibs $arg" ;;
  989. +      -l*)
  990. +    deplibs="$deplibs $arg"
  991. +    ;;
  992.  
  993. +      -module)
  994. +    if test "$module" != yes; then
  995. +      module=yes
  996. +      if test -n "$export_dynamic_flag_spec"; then
  997. +        eval arg=\"$export_dynamic_flag_spec\"
  998. +      else
  999. +        arg=
  1000. +      fi
  1001. +    fi
  1002. +    ;;
  1003. +    
  1004.        -no-undefined)
  1005.      allow_undefined=no
  1006.      continue
  1007. @@ -495,47 +1031,68 @@
  1008.  
  1009.        -o) prev=output ;;
  1010.  
  1011. +      -release)
  1012. +    prev=release
  1013. +    continue
  1014. +    ;;
  1015. +
  1016.        -rpath)
  1017. -        prev=rpath
  1018. -        continue
  1019. -        ;;
  1020. +    prev=rpath
  1021. +    continue
  1022. +    ;;
  1023. +
  1024. +      -R)
  1025. +    prev=xrpath
  1026. +    continue
  1027. +    ;;
  1028. +
  1029. +      -R*)
  1030. +    xrpath="$xrpath "`$echo "X$arg" | $Xsed -e 's/^-R//'`
  1031. +    continue
  1032. +    ;;
  1033.  
  1034.        -static)
  1035.      # If we have no pic_flag, then this is the same as -all-static.
  1036.      if test -z "$pic_flag" && test -n "$link_static_flag"; then
  1037. -          compile_command="$compile_command $link_static_flag"
  1038. +      compile_command="$compile_command $link_static_flag"
  1039.        finalize_command="$finalize_command $link_static_flag"
  1040. -        fi
  1041. +      dlopen_self=$dlopen_self_static
  1042. +    fi
  1043. +    continue
  1044. +    ;;
  1045. +
  1046. +      -thread-safe)
  1047. +    thread_safe=yes
  1048.      continue
  1049.      ;;
  1050.  
  1051.        -version-info)
  1052. -        prev=vinfo
  1053. -        continue
  1054. -        ;;
  1055. +    prev=vinfo
  1056. +    continue
  1057. +    ;;
  1058.  
  1059.        # Some other compiler flag.
  1060.        -* | +*)
  1061.      # Unknown arguments in both finalize_command and compile_command need
  1062.      # to be aesthetically quoted because they are evaled later.
  1063. -    arg=`$echo "$arg" | sed "$sed_quote_subst"`
  1064. +    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1065.      case "$arg" in
  1066.      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  1067.        arg="\"$arg\""
  1068.        ;;
  1069.      esac
  1070. -        ;;
  1071. +    ;;
  1072.  
  1073. -      *.o | *.a)
  1074. -        # A standard object.
  1075. -        objs="$objs $arg"
  1076. -        ;;
  1077. +      *.o | *.obj | *.a | *.lib)
  1078. +    # A standard object.
  1079. +    objs="$objs $arg"
  1080. +    ;;
  1081.  
  1082.        *.lo)
  1083. -        # A library object.
  1084. +    # A library object.
  1085.      if test "$prev" = dlfiles; then
  1086.        dlfiles="$dlfiles $arg"
  1087. -      if test "$build_libtool_libs" = yes; then
  1088. +      if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then
  1089.          prev=
  1090.          continue
  1091.        else
  1092. @@ -546,188 +1103,268 @@
  1093.  
  1094.      if test "$prev" = dlprefiles; then
  1095.        # Preload the old-style object.
  1096. -      dlprefiles="$dlprefiles "`$echo "$arg" | sed 's/\.lo$/\.o/'`
  1097. +      dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"`
  1098.        prev=
  1099.      fi
  1100.      libobjs="$libobjs $arg"
  1101. -        ;;
  1102. +    ;;
  1103.  
  1104.        *.la)
  1105. -        # A libtool-controlled library.
  1106. +    # A libtool-controlled library.
  1107.  
  1108. -        dlname=
  1109. -        libdir=
  1110. -        library_names=
  1111. -        old_library=
  1112. -
  1113. -        # Check to see that this really is a libtool archive.
  1114. -        if egrep '^# Generated by ltmain.sh' $arg >/dev/null 2>&1; then :
  1115. -        else
  1116. -          $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1117. -          exit 1
  1118. -        fi
  1119. -
  1120. -        # If there is no directory component, then add one.
  1121. -        case "$arg" in
  1122. -        */*) . $arg ;;
  1123. -        *) . ./$arg ;;
  1124. -        esac
  1125. -
  1126. -        if test -z "$libdir"; then
  1127. -          $echo "$modename: \`$arg' contains no -rpath information" 1>&2
  1128. -          exit 1
  1129. -        fi
  1130. -
  1131. -        # Get the name of the library we link against.
  1132. -        linklib=
  1133. -        for l in $old_library $library_names; do
  1134. -          linklib="$l"
  1135. -        done
  1136. -
  1137. -        if test -z "$linklib"; then
  1138. -          $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1139. -          exit 1
  1140. -        fi
  1141. -
  1142. -        # Find the relevant object directory and library name.
  1143. -        name=`$echo "$arg" | sed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1144. -        dir=`$echo "$arg" | sed 's%/[^/]*$%%'`
  1145. -        if test "X$dir" = "X$arg"; then
  1146. -          dir="$objdir"
  1147. -        else
  1148. -          dir="$dir/$objdir"
  1149. -        fi
  1150. -
  1151. -        # This library was specified with -dlopen.
  1152. -        if test "$prev" = dlfiles; then
  1153. -          dlfiles="$dlfiles $arg"
  1154. -          if test -z "$dlname"; then
  1155. -            # If there is no dlname, we need to preload.
  1156. -            prev=dlprefiles
  1157. -          else
  1158. -            # We should not create a dependency on this library.
  1159. -            prev=
  1160. -            continue
  1161. -          fi
  1162. -        fi
  1163. -
  1164. -        # The library was specified with -dlpreopen.
  1165. -        if test "$prev" = dlprefiles; then
  1166. -          # Prefer using a static library (so that no silly _DYNAMIC symbols
  1167. -          # are required to link).
  1168. -          if test -n "$old_library"; then
  1169. -            dlprefiles="$dlprefiles $dir/$old_library"
  1170. -          else
  1171. -            dlprefiles="$dlprefiles $dir/$linklib"
  1172. -          fi
  1173. -          prev=
  1174. -        fi
  1175. -
  1176. -        if test "$build_libtool_libs" = yes && test -n "$library_names"; then
  1177. -          link_against_libtool_libs="$link_against_libtool_libs $arg"
  1178. -          if test -n "$shlibpath_var"; then
  1179. -            # Make sure the rpath contains only unique directories.
  1180. -            case "$temp_rpath " in
  1181. -            *" $dir "*) ;;
  1182. -            *) temp_rpath="$temp_rpath $dir" ;;
  1183. -            esac
  1184. -          fi
  1185. +    dlname=
  1186. +    libdir=
  1187. +    library_names=
  1188. +    old_library=
  1189.  
  1190. +    # Check to see that this really is a libtool archive.
  1191. +    if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  1192. +    else
  1193. +      $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2
  1194. +      exit 1
  1195. +    fi
  1196. +
  1197. +    # If the library was installed with an old release of libtool,
  1198. +    # it will not redefine variable installed.
  1199. +    installed=yes
  1200. +
  1201. +    # If there is no directory component, then add one.
  1202. +    case "$arg" in
  1203. +    */* | *\\*) . $arg ;;
  1204. +    *) . ./$arg ;;
  1205. +    esac
  1206. +
  1207. +    # Get the name of the library we link against.
  1208. +    linklib=
  1209. +    for l in $old_library $library_names; do
  1210. +      linklib="$l"
  1211. +    done
  1212. +
  1213. +    if test -z "$linklib"; then
  1214. +      $echo "$modename: cannot find name of link library for \`$arg'" 1>&2
  1215. +      exit 1
  1216. +    fi
  1217. +
  1218. +    # Find the relevant object directory and library name.
  1219. +    name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'`
  1220. +
  1221. +    if test "X$installed" = Xyes; then
  1222. +      dir="$libdir"
  1223. +    else
  1224. +      dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
  1225. +      if test "X$dir" = "X$arg"; then
  1226. +        dir="$objdir"
  1227. +      else
  1228. +        dir="$dir/$objdir"
  1229. +      fi
  1230. +    fi
  1231. +
  1232. +    if test -n "$dependency_libs"; then
  1233. +      # Extract -R from dependency_libs
  1234. +      temp_deplibs=
  1235. +      for deplib in $dependency_libs; do
  1236. +        case "$deplib" in
  1237. +        -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
  1238. +         case " $rpath $xrpath " in
  1239. +         *" $temp_xrpath "*) ;;
  1240. +         *) xrpath="$xrpath $temp_xrpath";;
  1241. +         esac;;
  1242. +        -L*) case "$compile_command $temp_deplibs " in
  1243. +         *" $deplib "*) ;;
  1244. +         *) temp_deplibs="$temp_deplibs $deplib";;
  1245. +         esac;;
  1246. +        *) temp_deplibs="$temp_deplibs $deplib";;
  1247. +        esac
  1248. +      done
  1249. +      dependency_libs="$temp_deplibs"
  1250. +    fi
  1251. +
  1252. +    if test -z "$libdir"; then
  1253. +      # It is a libtool convenience library, so add in its objects.
  1254. +      convenience="$convenience $dir/$old_library"
  1255. +      old_convenience="$old_convenience $dir/$old_library"
  1256. +      deplibs="$deplibs$dependency_libs"
  1257. +      compile_command="$compile_command $dir/$old_library$dependency_libs"
  1258. +      finalize_command="$finalize_command $dir/$old_library$dependency_libs"
  1259. +      continue
  1260. +    fi
  1261. +
  1262. +    # This library was specified with -dlopen.
  1263. +    if test "$prev" = dlfiles; then
  1264. +      dlfiles="$dlfiles $arg"
  1265. +      if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then
  1266. +        # If there is no dlname, no dlopen support or we're linking statically,
  1267. +        # we need to preload.
  1268. +        prev=dlprefiles
  1269. +      else
  1270. +        # We should not create a dependency on this library, but we
  1271. +        # may need any libraries it requires.
  1272. +        compile_command="$compile_command$dependency_libs"
  1273. +        finalize_command="$finalize_command$dependency_libs"
  1274. +        prev=
  1275. +        continue
  1276. +      fi
  1277. +    fi
  1278. +
  1279. +    # The library was specified with -dlpreopen.
  1280. +    if test "$prev" = dlprefiles; then
  1281. +      # Prefer using a static library (so that no silly _DYNAMIC symbols
  1282. +      # are required to link).
  1283. +      if test -n "$old_library"; then
  1284. +        dlprefiles="$dlprefiles $dir/$old_library"
  1285. +      else
  1286. +        dlprefiles="$dlprefiles $dir/$linklib"
  1287. +      fi
  1288. +      prev=
  1289. +    fi
  1290. +
  1291. +    if test "$build_libtool_libs" = yes && test -n "$library_names"; then
  1292. +      link_against_libtool_libs="$link_against_libtool_libs $arg"
  1293. +      if test -n "$shlibpath_var"; then
  1294. +        # Make sure the rpath contains only unique directories.
  1295. +        case "$temp_rpath " in
  1296. +        *" $dir "*) ;;
  1297. +        *) temp_rpath="$temp_rpath $dir" ;;
  1298. +        esac
  1299. +      fi
  1300. +
  1301. +      # We need an absolute path.
  1302. +      case "$dir" in
  1303. +      /* | [A-Za-z]:[/\\]*) absdir="$dir" ;;
  1304. +      *)
  1305. +        absdir=`cd "$dir" && pwd`
  1306. +        if test -z "$absdir"; then
  1307. +          $echo "$modename: cannot determine absolute directory name of \`$libdir'" 1>&2
  1308. +          exit 1
  1309. +        fi
  1310. +        ;;
  1311. +      esac
  1312. +      
  1313.        # This is the magic to use -rpath.
  1314. -          if test -n "$hardcode_libdir_flag_spec"; then
  1315. -            if test -n "$hardcode_libdir_separator"; then
  1316. -              if test -z "$hardcode_libdirs"; then
  1317. -                # Put the magic libdir with the hardcode flag.
  1318. -                hardcode_libdirs="$libdir"
  1319. -                libdir="@HARDCODE_LIBDIRS@"
  1320. -              else
  1321. -                # Just accumulate the unique libdirs.
  1322. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  1323. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  1324. -          ;;
  1325. -        *)
  1326. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  1327. -          ;;
  1328. -        esac
  1329. -                libdir=
  1330. -              fi
  1331. -            fi
  1332. -
  1333. -            if test -n "$libdir"; then
  1334. -              flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
  1335. -
  1336. -              compile_command="$compile_command $flag"
  1337. -              finalize_command="$finalize_command $flag"
  1338. -            fi
  1339. -          elif test "$hardcode_runpath_var" = yes; then
  1340. -            # Do the same for the permanent run path.
  1341. -            case "$perm_rpath " in
  1342. -            *" $libdir "*) ;;
  1343. -            *) perm_rpath="$perm_rpath $libdir" ;;
  1344. -            esac
  1345. -          fi
  1346. -
  1347. -
  1348. -          case "$hardcode_action" in
  1349. -          immediate)
  1350. -            if test "$hardcode_direct" = no; then
  1351. -              compile_command="$compile_command $dir/$linklib"
  1352. -            elif test "$hardcode_minus_L" = no; then
  1353. -              compile_command="$compile_command -L$dir -l$name"
  1354. -            elif test "$hardcode_shlibpath_var" = no; then
  1355. -              compile_shlibpath="$compile_shlibpath$dir:"
  1356. -              compile_command="$compile_command -l$name"
  1357. -            fi
  1358. -            ;;
  1359. -
  1360. -          relink)
  1361. -            # We need an absolute path.
  1362. -            case "$dir" in
  1363. -            /*) ;;
  1364. -            *)
  1365. -              absdir=`cd "$dir" && pwd`
  1366. -              if test -z "$absdir"; then
  1367. -                $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
  1368. -                exit 1
  1369. -              fi
  1370. -              dir="$absdir"
  1371. -              ;;
  1372. -            esac
  1373. -
  1374. -            if test "$hardcode_direct" = yes; then
  1375. -              compile_command="$compile_command $dir/$linklib"
  1376. -            elif test "$hardcode_minus_L" = yes; then
  1377. -              compile_command="$compile_command -L$dir -l$name"
  1378. -            elif test "$hardcode_shlibpath_var" = yes; then
  1379. -              compile_shlibpath="$compile_shlibpath$dir:"
  1380. -              compile_command="$compile_command -l$name"
  1381. -            fi
  1382. -            ;;
  1383. -
  1384. -          *)
  1385. -            $echo "$modename: \`$hardcode_action' is an unknown hardcode action" 1>&2
  1386. -            exit 1
  1387. -            ;;
  1388. -          esac
  1389. -
  1390. -          # Finalize command for both is simple: just hardcode it.
  1391. -          if test "$hardcode_direct" = yes; then
  1392. -            finalize_command="$finalize_command $libdir/$linklib"
  1393. -          elif test "$hardcode_minus_L" = yes; then
  1394. -            finalize_command="$finalize_command -L$libdir -l$name"
  1395. -          elif test "$hardcode_shlibpath_var" = yes; then
  1396. -            finalize_shlibpath="$finalize_shlibpath$libdir:"
  1397. -            finalize_command="$finalize_command -l$name"
  1398. -          else
  1399. -            # We can't seem to hardcode it, guess we'll fake it.
  1400. -            finalize_command="$finalize_command -L$libdir -l$name"
  1401. -          fi
  1402. -        else
  1403. -          # Transform directly to old archives if we don't build new libraries.
  1404. -          if test -n "$pic_flag" && test -z "$old_library"; then
  1405. -            $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1406. -            exit 1
  1407. -          fi
  1408. +      # Skip directories that are in the system default run-time
  1409. +      # search path, unless they have been requested with -R.
  1410. +      case " $sys_lib_dlsearch_path " in
  1411. +       *" $absdir "*) ;;
  1412. +      *)
  1413. +        case "$compile_rpath " in
  1414. +        *" $absdir "*) ;;
  1415. +        *) compile_rpath="$compile_rpath $absdir" 
  1416. +        esac
  1417. +        ;;
  1418. +       esac
  1419. +
  1420. +      case " $sys_lib_dlsearch_path " in
  1421. +       *" $libdir "*) ;;
  1422. +      *)
  1423. +        case "$finalize_rpath " in
  1424. +        *" $libdir "*) ;;
  1425. +        *) finalize_rpath="$finalize_rpath $libdir"
  1426. +        esac
  1427. +        ;;
  1428. +       esac
  1429. +
  1430. +      lib_linked=yes
  1431. +      case "$hardcode_action" in
  1432. +      immediate | unsupported)
  1433. +        if test "$hardcode_direct" = no; then
  1434. +          compile_command="$compile_command $dir/$linklib"
  1435. +          deplibs="$deplibs $dir/$linklib"
  1436. +          case "$host" in
  1437. +          *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1438. +        dllsearchdir=`cd "$dir" && pwd || echo "$dir"`
  1439. +        if test -n "$dllsearchpath"; then
  1440. +          dllsearchpath="$dllsearchpath:$dllsearchdir"
  1441. +        else
  1442. +          dllsearchpath="$dllsearchdir"
  1443. +        fi
  1444. +        ;;
  1445. +          esac
  1446. +        elif test "$hardcode_minus_L" = no; then
  1447. +          case "$host" in
  1448. +          *-*-sunos*)
  1449. +        compile_shlibpath="$compile_shlibpath$dir:"
  1450. +        ;;
  1451. +          esac
  1452. +          case "$compile_command " in
  1453. +          *" -L$dir "*) ;;
  1454. +          *) compile_command="$compile_command -L$dir";;
  1455. +          esac
  1456. +          compile_command="$compile_command -l$name"
  1457. +          deplibs="$deplibs -L$dir -l$name"
  1458. +        elif test "$hardcode_shlibpath_var" = no; then
  1459. +          case ":$compile_shlibpath:" in
  1460. +          *":$dir:"*) ;;
  1461. +          *) compile_shlibpath="$compile_shlibpath$dir:";;
  1462. +          esac
  1463. +          compile_command="$compile_command -l$name"
  1464. +          deplibs="$deplibs -l$name"
  1465. +        else
  1466. +          lib_linked=no
  1467. +        fi
  1468. +        ;;
  1469. +
  1470. +      relink)
  1471. +        if test "$hardcode_direct" = yes; then
  1472. +          compile_command="$compile_command $absdir/$linklib"
  1473. +          deplibs="$deplibs $absdir/$linklib"
  1474. +        elif test "$hardcode_minus_L" = yes; then
  1475. +          case "$compile_command " in
  1476. +          *" -L$absdir "*) ;;
  1477. +          *) compile_command="$compile_command -L$absdir";;
  1478. +          esac
  1479. +          compile_command="$compile_command -l$name"
  1480. +          deplibs="$deplibs -L$absdir -l$name"
  1481. +        elif test "$hardcode_shlibpath_var" = yes; then
  1482. +          case ":$compile_shlibpath:" in
  1483. +          *":$absdir:"*) ;;
  1484. +          *) compile_shlibpath="$compile_shlibpath$absdir:";;
  1485. +          esac
  1486. +          compile_command="$compile_command -l$name"
  1487. +          deplibs="$deplibs -l$name"
  1488. +        else
  1489. +          lib_linked=no
  1490. +        fi
  1491. +        ;;
  1492. +
  1493. +      *)
  1494. +        lib_linked=no
  1495. +        ;;
  1496. +      esac
  1497. +
  1498. +      if test "$lib_linked" != yes; then
  1499. +        $echo "$modename: configuration error: unsupported hardcode properties"
  1500. +        exit 1
  1501. +      fi
  1502. +
  1503. +      # Finalize command for both is simple: just hardcode it.
  1504. +      if test "$hardcode_direct" = yes; then
  1505. +        finalize_command="$finalize_command $libdir/$linklib"
  1506. +      elif test "$hardcode_minus_L" = yes; then
  1507. +        case "$finalize_command " in
  1508. +        *" -L$libdir "*) ;;
  1509. +        *) finalize_command="$finalize_command -L$libdir";;
  1510. +        esac
  1511. +        finalize_command="$finalize_command -l$name"
  1512. +      elif test "$hardcode_shlibpath_var" = yes; then
  1513. +        case ":$finalize_shlibpath:" in
  1514. +        *":$libdir:"*) ;;
  1515. +        *) finalize_shlibpath="$finalize_shlibpath$libdir:";;
  1516. +        esac
  1517. +        finalize_command="$finalize_command -l$name"
  1518. +      else
  1519. +        # We cannot seem to hardcode it, guess we'll fake it.
  1520. +        case "$finalize_command " in
  1521. +        *" -L$dir "*) ;;
  1522. +        *) finalize_command="$finalize_command -L$libdir";;
  1523. +        esac
  1524. +        finalize_command="$finalize_command -l$name"
  1525. +      fi
  1526. +    else
  1527. +      # Transform directly to old archives if we don't build new libraries.
  1528. +      if test -n "$pic_flag" && test -z "$old_library"; then
  1529. +        $echo "$modename: cannot find static library for \`$arg'" 1>&2
  1530. +        exit 1
  1531. +      fi
  1532.  
  1533.        # Here we assume that one of hardcode_direct or hardcode_minus_L
  1534.        # is not unsupported.  This is valid on all known static and
  1535. @@ -737,24 +1374,36 @@
  1536.          compile_command="$compile_command $dir/$linklib"
  1537.          finalize_command="$finalize_command $dir/$linklib"
  1538.        else
  1539. -        compile_command="$compile_command -L$dir -l$name"
  1540. -        finalize_command="$finalize_command -L$dir -l$name"
  1541. +        case "$compile_command " in
  1542. +        *" -L$dir "*) ;;
  1543. +        *) compile_command="$compile_command -L$dir";;
  1544. +        esac
  1545. +        compile_command="$compile_command -l$name"
  1546. +        case "$finalize_command " in
  1547. +        *" -L$dir "*) ;;
  1548. +        *) finalize_command="$finalize_command -L$dir";;
  1549. +        esac
  1550. +        finalize_command="$finalize_command -l$name"
  1551.        fi
  1552. -        fi
  1553. +    fi
  1554. +
  1555. +    # Add in any libraries that this one depends upon.
  1556. +    compile_command="$compile_command$dependency_libs"
  1557. +    finalize_command="$finalize_command$dependency_libs"
  1558.      continue
  1559. -        ;;
  1560. +    ;;
  1561.  
  1562.        # Some other compiler argument.
  1563.        *)
  1564.      # Unknown arguments in both finalize_command and compile_command need
  1565.      # to be aesthetically quoted because they are evaled later.
  1566. -    arg=`$echo "$arg" | sed "$sed_quote_subst"`
  1567. +    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  1568.      case "$arg" in
  1569.      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  1570.        arg="\"$arg\""
  1571.        ;;
  1572.      esac
  1573. -        ;;
  1574. +    ;;
  1575.        esac
  1576.  
  1577.        # Now actually substitute the argument into the commands.
  1578. @@ -770,8 +1419,11 @@
  1579.        exit 1
  1580.      fi
  1581.  
  1582. -    oldlib=
  1583. -    oldobjs=
  1584. +    oldlibs=
  1585. +    # calculate the name of the file, without its directory
  1586. +    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
  1587. +    libobjs_save="$libobjs"
  1588. +
  1589.      case "$output" in
  1590.      "")
  1591.        $echo "$modename: you must specify an output file" 1>&2
  1592. @@ -779,58 +1431,93 @@
  1593.        exit 1
  1594.        ;;
  1595.  
  1596. -    */*)
  1597. -      $echo "$modename: output file \`$output' must have no directory components" 1>&2
  1598. -      exit 1
  1599. +    *.a | *.lib)
  1600. +      if test -n "$link_against_libtool_libs"; then
  1601. +    $echo "$modename: error: cannot link libtool libraries into archives" 1>&2
  1602. +    exit 1
  1603. +      fi
  1604. +
  1605. +      if test -n "$deplibs"; then
  1606. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
  1607. +      fi
  1608. +
  1609. +      if test -n "$dlfiles$dlprefiles"; then
  1610. +    $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
  1611. +      fi
  1612. +
  1613. +      if test -n "$rpath"; then
  1614. +    $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
  1615. +      fi
  1616. +
  1617. +      if test -n "$xrpath"; then
  1618. +    $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
  1619. +      fi
  1620. +
  1621. +      if test -n "$vinfo"; then
  1622. +    $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
  1623. +      fi
  1624. +
  1625. +      if test -n "$release"; then
  1626. +    $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
  1627. +      fi
  1628. +
  1629. +      if test -n "$export_symbols"; then
  1630. +    $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
  1631. +      fi
  1632. +
  1633. +      # Now set the variables for building old libraries.
  1634. +      build_libtool_libs=no
  1635. +      oldlibs="$output"
  1636.        ;;
  1637.  
  1638.      *.la)
  1639.        # Make sure we only generate libraries of the form `libNAME.la'.
  1640. -      case "$output" in
  1641. -      lib*) ;;
  1642. +      case "$outputname" in
  1643. +      lib*)
  1644. +    name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
  1645. +    eval libname=\"$libname_spec\"
  1646. +    ;;
  1647.        *)
  1648. -    $echo "$modename: libtool library \`$arg' must begin with \`lib'" 1>&2
  1649. -    $echo "$help" 1>&2
  1650. -    exit 1
  1651. +    if test "$module" = no; then
  1652. +      $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
  1653. +      $echo "$help" 1>&2
  1654. +      exit 1
  1655. +    fi
  1656. +    if test "$need_lib_prefix" != no; then
  1657. +      # Add the "lib" prefix for modules if required
  1658. +      name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1659. +      eval libname=\"$libname_spec\"
  1660. +    else
  1661. +      libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
  1662. +    fi
  1663.      ;;
  1664.        esac
  1665.  
  1666. -      name=`$echo "$output" | sed -e 's/\.la$//' -e 's/^lib//'`
  1667. -      libname=`eval \\$echo \"$libname_spec\"`
  1668. +      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  1669. +      if test "X$output_objdir" = "X$output"; then
  1670. +    output_objdir="$objdir"
  1671. +      else
  1672. +    output_objdir="$output_objdir/$objdir"
  1673. +      fi
  1674.  
  1675.        # All the library-specific variables (install_libdir is set above).
  1676.        library_names=
  1677.        old_library=
  1678.        dlname=
  1679. -      current=0
  1680. -      revision=0
  1681. -      age=0
  1682.  
  1683.        if test -n "$objs"; then
  1684. -        $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1685. -        exit 1
  1686. +    $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1
  1687. +    exit 1
  1688.        fi
  1689.  
  1690.        # How the heck are we supposed to write a wrapper for a shared library?
  1691.        if test -n "$link_against_libtool_libs"; then
  1692. -        $echo "$modename: libtool library \`$output' may not depend on uninstalled libraries:$link_against_libtool_libs" 1>&2
  1693. -        exit 1
  1694. +     $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2
  1695. +     exit 1
  1696.        fi
  1697.  
  1698. -      # Add libc to deplibs on all systems.
  1699. -      deplibs="$deplibs -lc"
  1700. -
  1701.        if test -n "$dlfiles$dlprefiles"; then
  1702. -        $echo "$modename: warning: \`-dlopen' is ignored while creating libtool libraries" 1>&2
  1703. -        # Nullify the symbol file.
  1704. -        compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
  1705. -        finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
  1706. -      fi
  1707. -
  1708. -      if test -z "$rpath"; then
  1709. -        $echo "$modename: you must specify an installation directory with \`-rpath'" 1>&2
  1710. -    $echo "$help" 1>&2
  1711. -        exit 1
  1712. +    $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2
  1713.        fi
  1714.  
  1715.        set dummy $rpath
  1716. @@ -839,222 +1526,593 @@
  1717.        fi
  1718.        install_libdir="$2"
  1719.  
  1720. -      # Parse the version information argument.
  1721. -      IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
  1722. -      set dummy $vinfo
  1723. -      IFS="$save_ifs"
  1724. +      oldlibs=
  1725. +      if test -z "$rpath"; then
  1726. +    if test "$build_libtool_libs" = yes; then
  1727. +      # Building a libtool convenience library.
  1728. +      libext=al
  1729. +      oldlibs="$output_objdir/$libname.$libext $oldlibs"
  1730. +      build_libtool_libs=convenience
  1731. +      build_old_libs=yes
  1732. +    fi
  1733. +    dependency_libs="$deplibs"
  1734.  
  1735. -      if test -n "$5"; then
  1736. -        $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1737. -        $echo "$help" 1>&2
  1738. -        exit 1
  1739. -      fi
  1740. +    if test -n "$vinfo"; then
  1741. +      $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
  1742. +    fi
  1743.  
  1744. -      test -n "$2" && current="$2"
  1745. -      test -n "$3" && revision="$3"
  1746. -      test -n "$4" && age="$4"
  1747. -
  1748. -      # Check that each of the things are valid numbers.
  1749. -      case "$current" in
  1750. -      0 | [1-9] | [1-9][0-9]*) ;;
  1751. -      *)
  1752. -        $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1753. -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1754. -        exit 1
  1755. -        ;;
  1756. -      esac
  1757. +    if test -n "$release"; then
  1758. +      $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
  1759. +    fi
  1760. +      else
  1761.  
  1762. -      case "$revision" in
  1763. -      0 | [1-9] | [1-9][0-9]*) ;;
  1764. -      *)
  1765. -        $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1766. -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1767. -        exit 1
  1768. -        ;;
  1769. -      esac
  1770. +    # Parse the version information argument.
  1771. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS=':'
  1772. +    set dummy $vinfo 0 0 0
  1773. +    IFS="$save_ifs"
  1774. +
  1775. +    if test -n "$8"; then
  1776. +      $echo "$modename: too many parameters to \`-version-info'" 1>&2
  1777. +      $echo "$help" 1>&2
  1778. +      exit 1
  1779. +    fi
  1780.  
  1781. -      case "$age" in
  1782. -      0 | [1-9] | [1-9][0-9]*) ;;
  1783. -      *)
  1784. -        $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1785. -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1786. -        exit 1
  1787. -        ;;
  1788. -      esac
  1789. +    current="$2"
  1790. +    revision="$3"
  1791. +    age="$4"
  1792. +
  1793. +    # Check that each of the things are valid numbers.
  1794. +    case "$current" in
  1795. +    0 | [1-9] | [1-9][0-9]*) ;;
  1796. +    *)
  1797. +      $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
  1798. +      $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1799. +      exit 1
  1800. +      ;;
  1801. +    esac
  1802.  
  1803. -      if test $age -gt $current; then
  1804. -        $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1805. -        $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1806. -        exit 1
  1807. -      fi
  1808. -
  1809. -      # Calculate the version variables.
  1810. -      version_vars="version_type current age revision"
  1811. -      case "$version_type" in
  1812. -      none) ;;
  1813. -
  1814. -      linux)
  1815. -        version_vars="$version_vars major versuffix"
  1816. -        major=`expr $current - $age`
  1817. -        versuffix="$major.$age.$revision"
  1818. -        ;;
  1819. -
  1820. -      osf)
  1821. -        version_vars="$version_vars versuffix verstring"
  1822. -        major=`expr $current - $age`
  1823. -        versuffix="$current.$age.$revision"
  1824. -        verstring="$versuffix"
  1825. -
  1826. -        # Add in all the interfaces that we are compatible with.
  1827. -        loop=$age
  1828. -        while test $loop != 0; do
  1829. -          iface=`expr $current - $loop`
  1830. -          loop=`expr $loop - 1`
  1831. -          verstring="$verstring:${iface}.0"
  1832. -        done
  1833. -
  1834. -        # Make executables depend on our current version.
  1835. -        verstring="$verstring:${current}.0"
  1836. -        ;;
  1837. -
  1838. -      sunos)
  1839. -        version_vars="$version_vars major versuffix"
  1840. -        major="$current"
  1841. -        versuffix="$current.$revision"
  1842. -        ;;
  1843. +    case "$revision" in
  1844. +    0 | [1-9] | [1-9][0-9]*) ;;
  1845. +    *)
  1846. +      $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
  1847. +      $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1848. +      exit 1
  1849. +      ;;
  1850. +    esac
  1851.  
  1852. -      *)
  1853. -        $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1854. -        echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  1855. -        exit 1
  1856. -        ;;
  1857. -      esac
  1858. +    case "$age" in
  1859. +    0 | [1-9] | [1-9][0-9]*) ;;
  1860. +    *)
  1861. +      $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
  1862. +      $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1863. +      exit 1
  1864. +      ;;
  1865. +    esac
  1866. +
  1867. +    if test $age -gt $current; then
  1868. +      $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
  1869. +      $echo "$modename: \`$vinfo' is not valid version information" 1>&2
  1870. +      exit 1
  1871. +    fi
  1872. +
  1873. +    # Calculate the version variables.
  1874. +    major=
  1875. +    versuffix=
  1876. +    verstring=
  1877. +    case "$version_type" in
  1878. +    none) ;;
  1879. +
  1880. +    irix)
  1881. +      major=`expr $current - $age + 1`
  1882. +      versuffix=".$major"
  1883. +      verstring="sgi$major.$revision"
  1884. +
  1885. +      # Add in all the interfaces that we are compatible with.
  1886. +      loop=$revision
  1887. +      while test $loop != 0; do
  1888. +        iface=`expr $revision - $loop`
  1889. +        loop=`expr $loop - 1`
  1890. +        verstring="sgi$major.$iface:$verstring"
  1891. +      done
  1892. +      ;;
  1893. +
  1894. +    linux)
  1895. +      major=.`expr $current - $age`
  1896. +      versuffix="$major.$age.$revision"
  1897. +      ;;
  1898. +
  1899. +    osf)
  1900. +      major=`expr $current - $age`
  1901. +      versuffix=".$current.$age.$revision"
  1902. +      verstring="$current.$age.$revision"
  1903. +
  1904. +      # Add in all the interfaces that we are compatible with.
  1905. +      loop=$age
  1906. +      while test $loop != 0; do
  1907. +        iface=`expr $current - $loop`
  1908. +        loop=`expr $loop - 1`
  1909. +        verstring="$verstring:${iface}.0"
  1910. +      done
  1911. +
  1912. +      # Make executables depend on our current version.
  1913. +      verstring="$verstring:${current}.0"
  1914. +      ;;
  1915. +
  1916. +    sunos)
  1917. +      major=".$current"
  1918. +      versuffix=".$current.$revision"
  1919. +      ;;
  1920. +
  1921. +    freebsd-aout)
  1922. +      major=".$current"
  1923. +      versuffix=".$current.$revision";
  1924. +      ;;
  1925. +
  1926. +    freebsd-elf)
  1927. +      major=".$current"
  1928. +      versuffix=".$current";
  1929. +      ;;
  1930. +
  1931. +    windows)
  1932. +      # Like Linux, but with '-' rather than '.', since we only
  1933. +      # want one extension on Windows 95.
  1934. +      major=`expr $current - $age`
  1935. +      versuffix="-$major-$age-$revision"
  1936. +      ;;
  1937. +
  1938. +    *)
  1939. +      $echo "$modename: unknown library version type \`$version_type'" 1>&2
  1940. +      echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
  1941. +      exit 1
  1942. +      ;;
  1943. +    esac
  1944. +
  1945. +    # Clear the version info if we defaulted, and they specified a release.
  1946. +    if test -z "$vinfo" && test -n "$release"; then
  1947. +      major=
  1948. +      verstring="0.0"
  1949. +      if test "$need_version" = no; then
  1950. +        versuffix=
  1951. +      else
  1952. +        versuffix=".0.0"
  1953. +      fi
  1954. +    fi
  1955. +
  1956. +    # Remove version info from name if versioning should be avoided
  1957. +    if test "$avoid_version" = yes && test "$need_version" = no; then
  1958. +      major=
  1959. +      versuffix=
  1960. +      verstring=""
  1961. +    fi
  1962. +    
  1963. +    # Check to see if the archive will have undefined symbols.
  1964. +    if test "$allow_undefined" = yes; then
  1965. +      if test "$allow_undefined_flag" = unsupported; then
  1966. +        $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  1967. +        build_libtool_libs=no
  1968. +        build_old_libs=yes
  1969. +      fi
  1970. +    else
  1971. +      # Don't allow undefined symbols.
  1972. +      allow_undefined_flag="$no_undefined_flag"
  1973. +    fi
  1974. +
  1975. +    dependency_libs="$deplibs"
  1976. +    case "$host" in
  1977. +    *-*-cygwin* | *-*-mingw* | *-*-os2*)
  1978. +      # these systems don't actually have a c library (as such)!
  1979. +      ;;
  1980. +    *)
  1981. +      # Add libc to deplibs on all other systems.
  1982. +      deplibs="$deplibs -lc"
  1983. +      ;;
  1984. +    esac
  1985. +      fi
  1986.  
  1987.        # Create the output directory, or remove our outputs if we need to.
  1988. -      if test -d $objdir; then
  1989. -        $show "$rm $objdir/$output $objdir/$libname.*"
  1990. -        $run $rm $objdir/$output $objdir/$libname.*
  1991. +      if test -d $output_objdir; then
  1992. +    $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*"
  1993. +    $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*
  1994.        else
  1995. -        $show "$mkdir $objdir"
  1996. -        $run $mkdir $objdir
  1997. +    $show "$mkdir $output_objdir"
  1998. +    $run $mkdir $output_objdir
  1999.      status=$?
  2000. -    if test $status -eq 0 || test -d $objdir; then :
  2001. -    else
  2002. +    if test $status -ne 0 && test ! -d $output_objdir; then
  2003.        exit $status
  2004.      fi
  2005.        fi
  2006.  
  2007. -      # Check to see if the archive will have undefined symbols.
  2008. -      if test "$allow_undefined" = yes; then
  2009. -        if test "$allow_undefined_flag" = unsupported; then
  2010. -          $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
  2011. -          build_libtool_libs=no
  2012. -      build_old_libs=yes
  2013. -        fi
  2014. -      else
  2015. -        # Clear the flag.
  2016. -        allow_undefined_flag=
  2017. +      # Now set the variables for building old libraries.
  2018. +      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
  2019. +    oldlibs="$oldlibs $output_objdir/$libname.$libext"
  2020. +
  2021. +    # Transform .lo files to .o files.
  2022. +    oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
  2023.        fi
  2024.  
  2025.        if test "$build_libtool_libs" = yes; then
  2026. -        # Get the real and link names of the library.
  2027. -        library_names=`eval \\$echo \"$library_names_spec\"`
  2028. -        set dummy $library_names
  2029. -        realname="$2"
  2030. -        shift; shift
  2031. -
  2032. -        if test -n "$soname_spec"; then
  2033. -          soname=`eval \\$echo \"$soname_spec\"`
  2034. -        else
  2035. -          soname="$realname"
  2036. -        fi
  2037. +    # Transform deplibs into only deplibs that can be linked in shared.
  2038. +    name_save=$name
  2039. +    libname_save=$libname
  2040. +    release_save=$release
  2041. +    versuffix_save=$versuffix
  2042. +    major_save=$major
  2043. +    # I'm not sure if I'm treating the release correctly.  I think
  2044. +    # release should show up in the -l (ie -lgmp5) so we don't want to
  2045. +    # add it in twice.  Is that correct?
  2046. +    release=""
  2047. +    versuffix=""
  2048. +    major=""
  2049. +    newdeplibs=
  2050. +    droppeddeps=no
  2051. +    case "$deplibs_check_method" in
  2052. +    pass_all)
  2053. +      newdeplibs=$deplibs
  2054. +            ;; # Don't check for shared/static.  Everything works.
  2055. +               # This might be a little naive.  We might want to check
  2056. +               # whether the library exists or not.  But this is on
  2057. +               # osf3 & osf4 and I'm not really sure... Just
  2058. +               # implementing what was already the behaviour.
  2059. +    test_compile)
  2060. +      # This code stresses the "libraries are programs" paradigm to its
  2061. +      # limits. Maybe even breaks it.  We compile a program, linking it
  2062. +      # against the deplibs as a proxy for the library.  Then we can check
  2063. +      # whether they linked in statically or dynamically with ldd.
  2064. +      $rm conftest.c
  2065. +      cat > conftest.c <<EOF
  2066. +      int main() { return 0; }
  2067. +EOF
  2068. +      $rm conftest
  2069. +      $C_compiler -o conftest conftest.c $deplibs
  2070. +      if test $? -eq 0 ; then
  2071. +        ldd_output=`ldd conftest`
  2072. +        for i in $deplibs; do
  2073. +          name="`expr $i : '-l\(.*\)'`"
  2074. +          # If $name is empty we are operating on a -L argument.
  2075. +          if test "$name" != "" ; then
  2076. +        libname=`eval \\$echo \"$libname_spec\"`
  2077. +        deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2078. +        set dummy $deplib_matches
  2079. +        deplib_match=$2
  2080. +        if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2081. +          newdeplibs="$newdeplibs $i"
  2082. +        else
  2083. +          droppeddeps=yes
  2084. +          echo
  2085. +          echo "*** Warning: This library needs some functionality provided by $i."
  2086. +          echo "*** I have the capability to make that library automatically link in when"
  2087. +          echo "*** you link to this library.  But I can only do this if you have a"
  2088. +          echo "*** shared version of the library, which you do not appear to have."
  2089. +        fi
  2090. +          else
  2091. +        newdeplibs="$newdeplibs $i"
  2092. +          fi
  2093. +        done
  2094. +      else
  2095. +        # Error occured in the first compile.  Let's try to salvage the situation:
  2096. +        # Compile a seperate program for each library.
  2097. +        for i in $deplibs; do
  2098. +          name="`expr $i : '-l\(.*\)'`"
  2099. +         # If $name is empty we are operating on a -L argument.
  2100. +          if test "$name" != "" ; then
  2101. +        $rm conftest
  2102. +        $C_compiler -o conftest conftest.c $i
  2103. +        # Did it work?
  2104. +        if test $? -eq 0 ; then
  2105. +          ldd_output=`ldd conftest`
  2106. +            libname=`eval \\$echo \"$libname_spec\"`
  2107. +            deplib_matches=`eval \\$echo \"$library_names_spec\"`
  2108. +            set dummy $deplib_matches
  2109. +            deplib_match=$2
  2110. +            if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
  2111. +              newdeplibs="$newdeplibs $i"
  2112. +            else
  2113. +              droppeddeps=yes
  2114. +              echo
  2115. +              echo "*** Warning: This library needs some functionality provided by $i."
  2116. +              echo "*** I have the capability to make that library automatically link in when"
  2117. +              echo "*** you link to this library.  But I can only do this if you have a"
  2118. +              echo "*** shared version of the library, which you do not appear to have."
  2119. +            fi
  2120. +        else
  2121. +          droppeddeps=yes
  2122. +          echo
  2123. +          echo "*** Warning!  Library $i is needed by this library but I was not able to"
  2124. +          echo "***  make it link in!  You will probably need to install it or some"
  2125. +          echo "*** library that it depends on before this library will be fully"
  2126. +          echo "*** functional.  Installing it before continuing would be even better."
  2127. +        fi
  2128. +          else
  2129. +        newdeplibs="$newdeplibs $i"
  2130. +          fi
  2131. +        done
  2132. +      fi
  2133. +      deplibs=$newdeplibs
  2134. +      ;;
  2135. +    file_magic*)
  2136. +      set dummy $deplibs_check_method
  2137. +      file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`"
  2138. +      for a_deplib in $deplibs; do
  2139. +        name="`expr $a_deplib : '-l\(.*\)'`"
  2140. +        # If $name is empty we are operating on a -L argument.
  2141. +        if test "$name" != "" ; then
  2142. +          libname=`eval \\$echo \"$libname_spec\"`
  2143. +          for i in $lib_search_path; do
  2144. +            potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
  2145. +            for potent_lib in $potential_libs; do
  2146. +              # Follow soft links.
  2147. +              if ls -lLd "$potlib" 2>/dev/null \
  2148. +             | grep " -> " >/dev/null; then
  2149. +            continue 
  2150. +              fi
  2151. +              # The statement above tries to avoid entering an
  2152. +              # endless loop below, in case of cyclic links.
  2153. +              # We might still enter an endless loop, since a link
  2154. +              # loop can be closed while we follow links,
  2155. +              # but so what?
  2156. +              potlib="$potent_lib"
  2157. +              while test -h "$potlib" 2>/dev/null; do
  2158. +            potliblink=`ls -ld $potlib | sed 's/.* -> //'`
  2159. +            case "$potliblink" in
  2160. +            /*) potlib="$potliblink";;
  2161. +            *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
  2162. +            esac
  2163. +              done
  2164. +              if eval $file_magic_cmd \"\$potlib\" \
  2165. +             | sed 10q \
  2166. +             | egrep "$file_magic_regex" > /dev/null; then
  2167. +            newdeplibs="$newdeplibs $a_deplib"
  2168. +            a_deplib=""
  2169. +            break 2
  2170. +              fi
  2171. +            done
  2172. +          done
  2173. +          if test -n "$a_deplib" ; then
  2174. +        droppeddeps=yes
  2175. +        echo
  2176. +        echo "*** Warning: This library needs some functionality provided by $a_deplib."
  2177. +        echo "*** I have the capability to make that library automatically link in when"
  2178. +        echo "*** you link to this library.  But I can only do this if you have a"
  2179. +        echo "*** shared version of the library, which you do not appear to have."
  2180. +          fi
  2181. +        else
  2182. +          # Add a -L argument.
  2183. +          newdeplibs="$newdeplibs $a_deplib"
  2184. +        fi
  2185. +      done # Gone through all deplibs.
  2186. +      ;;
  2187. +    none | unknown | *) newdeplibs=""
  2188. +      if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
  2189. +           -e 's/ -[LR][^ ]*//g' -e 's/[     ]//g' |
  2190. +         grep . >/dev/null; then
  2191. +        echo
  2192. +        if test "X$deplibs_check_method" = "Xnone"; then
  2193. +          echo "*** Warning: inter-library dependencies are not supported in this platform."
  2194. +        else
  2195. +          echo "*** Warning: inter-library dependencies are not known to be supported."
  2196. +        fi
  2197. +        echo "*** All declared inter-library dependencies are being dropped."
  2198. +        droppeddeps=yes
  2199. +      fi
  2200. +      ;;
  2201. +    esac
  2202. +    versuffix=$versuffix_save
  2203. +    major=$major_save
  2204. +    release=$release_save
  2205. +    libname=$libname_save
  2206. +    name=$name_save
  2207. +
  2208. +    if test "$droppeddeps" = yes; then
  2209. +      if test "$module" = yes; then
  2210. +        echo
  2211. +        echo "*** Warning: libtool could not satisfy all declared inter-library"
  2212. +        echo "*** dependencies of module $libname.  Therefore, libtool will create"
  2213. +        echo "*** a static module, that should work as long as the dlopening"
  2214. +        echo "*** application is linked with the -dlopen flag."
  2215. +        if test -z "$global_symbol_pipe"; then
  2216. +          echo
  2217. +          echo "*** However, this would only work if libtool was able to extract symbol"
  2218. +          echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
  2219. +          echo "*** not find such a program.  So, this module is probably useless."
  2220. +          echo "*** \`nm' from GNU binutils and a full rebuild may help."
  2221. +        fi
  2222. +        if test "$build_old_libs" = no; then
  2223. +          oldlibs="$output_objdir/$libname.$libext"
  2224. +          build_libtool_libs=module
  2225. +          build_old_libs=yes
  2226. +        else
  2227. +          build_libtool_libs=no
  2228. +        fi
  2229. +        dlname=
  2230. +        library_names=
  2231. +      else
  2232. +        echo "*** The inter-library dependencies that have been dropped here will be"
  2233. +        echo "*** automatically added whenever a program is linked with this library"
  2234. +        echo "*** or is declared to -dlopen it."
  2235. +      fi
  2236. +    fi
  2237. +      fi
  2238. +
  2239. +      # test again, we may have decided not to build it any more
  2240. +      if test "$build_libtool_libs" = yes; then
  2241. +    deplibs=$newdeplibs
  2242. +    # Done checking deplibs!
  2243. +    # Get the real and link names of the library.
  2244. +    eval library_names=\"$library_names_spec\"
  2245. +    set dummy $library_names
  2246. +    realname="$2"
  2247. +    shift; shift
  2248. +
  2249. +    if test -n "$soname_spec"; then
  2250. +      eval soname=\"$soname_spec\"
  2251. +    else
  2252. +      soname="$realname"
  2253. +    fi
  2254.  
  2255. -        lib="$objdir/$realname"
  2256. +    lib="$output_objdir/$realname"
  2257.      for link
  2258.      do
  2259.        linknames="$linknames $link"
  2260.      done
  2261.  
  2262. -        # Use standard objects if they are PIC.
  2263. -        test -z "$pic_flag" && libobjs=`$echo "$libobjs " | sed -e 's/\.lo /.o /g' -e 's/ $//g'`
  2264. +    # Ensure that we have .o objects for linkers which dislike .lo
  2265. +    # (e.g. aix) incase we are running --disable-static
  2266. +    for obj in $libobjs; do
  2267. +      oldobj=`$echo "X$obj" | $Xsed -e "$lo2o"`
  2268. +      test -f $oldobj || ${LN_S} $obj $oldobj
  2269. +    done
  2270. +
  2271. +    # Use standard objects if they are pic
  2272. +    test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2273. +
  2274. +    if test -n "$whole_archive_flag_spec"; then
  2275. +      if test -n "$convenience"; then
  2276. +        eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
  2277. +      fi
  2278. +    else
  2279. +      for xlib in $convenience; do
  2280. +        # Extract the objects.
  2281. +        xdir="$xlib"x
  2282. +        generated="$generated $xdir"
  2283. +        xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  2284. +
  2285. +        $show "${rm}r $xdir"
  2286. +        $run ${rm}r "$xdir"
  2287. +        $show "mkdir $xdir"
  2288. +        $run mkdir "$xdir"
  2289. +        status=$?
  2290. +        if test $status -ne 0 && test ! -d "$xdir"; then
  2291. +          exit $status
  2292. +        fi
  2293. +        $show "(cd $xdir && $AR x ../$xlib)"
  2294. +        $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  2295. +
  2296. +        libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  2297. +      done
  2298. +    fi
  2299. +
  2300. +    if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
  2301. +      eval flag=\"$thread_safe_flag_spec\"
  2302.  
  2303. -        # Do each of the archive commands.
  2304. -        cmds=`eval \\$echo \"$archive_cmds\"`
  2305. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  2306. -        for cmd in $cmds; do
  2307. -          IFS="$save_ifs"
  2308. -          $show "$cmd"
  2309. -          $run eval "$cmd" || exit $?
  2310. -        done
  2311. -        IFS="$save_ifs"
  2312. -
  2313. -        # Create links to the real library.
  2314. -        for linkname in $linknames; do
  2315. -          $show "(cd $objdir && $LN_S $realname $linkname)"
  2316. -          $run eval '(cd $objdir && $LN_S $realname $linkname)' || exit $?
  2317. -        done
  2318. -
  2319. -        # If -export-dynamic was specified, set the dlname.
  2320. -        if test "$export_dynamic" = yes; then
  2321. -          # On all known operating systems, these are identical.
  2322. -          dlname="$soname"
  2323. -        fi
  2324. +      linkopts="$linkopts $flag"
  2325. +    fi
  2326. +
  2327. +    # Prepare the list of exported symbols
  2328. +    if test -z "$export_symbols"; then
  2329. +      if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
  2330. +        $show "generating symbol list for \`$libname.la'"
  2331. +        export_symbols="$objdir/$libname.exp"
  2332. +        $run $rm $export_symbols
  2333. +        eval cmds=\"$export_symbols_cmds\"
  2334. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2335. +        for cmd in $cmds; do
  2336. +          IFS="$save_ifs"
  2337. +          $show "$cmd"
  2338. +          $run eval "$cmd" || exit $?
  2339. +        done
  2340. +        IFS="$save_ifs"
  2341. +        if test -n "$export_symbols_regex"; then
  2342. +          $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
  2343. +          $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
  2344. +          $show "$mv \"${export_symbols}T\" \"$export_symbols\""
  2345. +          $run eval '$mv "${export_symbols}T" "$export_symbols"'
  2346. +        fi
  2347. +      fi
  2348. +    fi
  2349. +
  2350. +    if test -n "$export_symbols" && test -n "$include_expsyms"; then
  2351. +      $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
  2352. +    fi
  2353. +
  2354. +    # Do each of the archive commands.
  2355. +    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
  2356. +      eval cmds=\"$archive_expsym_cmds\"
  2357. +    else
  2358. +      eval cmds=\"$archive_cmds\"
  2359. +    fi
  2360. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2361. +    for cmd in $cmds; do
  2362. +      IFS="$save_ifs"
  2363. +      $show "$cmd"
  2364. +      $run eval "$cmd" || exit $?
  2365. +    done
  2366. +    IFS="$save_ifs"
  2367. +
  2368. +    # Create links to the real library.
  2369. +    for linkname in $linknames; do
  2370. +      if test "$realname" != "$linkname"; then
  2371. +        $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
  2372. +        $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
  2373. +      fi
  2374. +    done
  2375. +
  2376. +    # If -module or -export-dynamic was specified, set the dlname.
  2377. +    if test "$module" = yes || test "$export_dynamic" = yes; then
  2378. +      # On all known operating systems, these are identical.
  2379. +      dlname="$soname"
  2380. +    fi
  2381.        fi
  2382.        ;;
  2383.  
  2384. -    *.lo | *.o)
  2385. +    *.lo | *.o | *.obj)
  2386.        if test -n "$link_against_libtool_libs"; then
  2387. -        $echo "$modename: error: cannot link libtool libraries into reloadable objects" 1>&2
  2388. -        exit 1
  2389. +    $echo "$modename: error: cannot link libtool libraries into objects" 1>&2
  2390. +    exit 1
  2391.        fi
  2392.  
  2393.        if test -n "$deplibs"; then
  2394. -        $echo "$modename: warning: \`-l' and \`-L' are ignored while creating objects" 1>&2
  2395. +    $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
  2396.        fi
  2397.  
  2398.        if test -n "$dlfiles$dlprefiles"; then
  2399. -        $echo "$modename: warning: \`-dlopen' is ignored while creating objects" 1>&2
  2400. -        # Nullify the symbol file.
  2401. -        compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
  2402. -        finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
  2403. +    $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
  2404.        fi
  2405.  
  2406.        if test -n "$rpath"; then
  2407. -        $echo "$modename: warning: \`-rpath' is ignored while creating objects" 1>&2
  2408. +    $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
  2409. +      fi
  2410. +
  2411. +      if test -n "$xrpath"; then
  2412. +    $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
  2413.        fi
  2414.  
  2415.        if test -n "$vinfo"; then
  2416. -        $echo "$modename: warning: \`-version-info' is ignored while creating objects" 1>&2
  2417. +    $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
  2418. +      fi
  2419. +
  2420. +      if test -n "$release"; then
  2421. +    $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
  2422.        fi
  2423.  
  2424.        case "$output" in
  2425.        *.lo)
  2426. -        if test -n "$objs"; then
  2427. -          $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2428. -          exit 1
  2429. -        fi
  2430. -        libobj="$output"
  2431. -        obj=`$echo "$output" | sed 's/\.lo$/.o/'`
  2432. -        ;;
  2433. +    if test -n "$objs"; then
  2434. +      $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
  2435. +      exit 1
  2436. +    fi
  2437. +    libobj="$output"
  2438. +    obj=`$echo "X$output" | $Xsed -e "$lo2o"`
  2439. +    ;;
  2440.        *)
  2441. -        libobj=
  2442. -        obj="$output"
  2443. -        ;;
  2444. +    libobj=
  2445. +    obj="$output"
  2446. +    ;;
  2447.        esac
  2448.  
  2449.        # Delete the old objects.
  2450.        $run $rm $obj $libobj
  2451.  
  2452.        # Create the old-style object.
  2453. -      reload_objs="$objs"`$echo "$libobjs " | sed -e 's/[^       ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
  2454. +      reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  2455.  
  2456.        output="$obj"
  2457. -      cmds=`eval \\$echo \"$reload_cmds\"`
  2458. -      IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  2459. +      eval cmds=\"$reload_cmds\"
  2460. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2461.        for cmd in $cmds; do
  2462. -        IFS="$save_ifs"
  2463. -        $show "$cmd"
  2464. -        $run eval "$cmd" || exit $?
  2465. +    IFS="$save_ifs"
  2466. +    $show "$cmd"
  2467. +    $run eval "$cmd" || exit $?
  2468.        done
  2469.        IFS="$save_ifs"
  2470.  
  2471. @@ -1062,457 +2120,734 @@
  2472.        test -z "$libobj" && exit 0
  2473.  
  2474.        if test "$build_libtool_libs" != yes; then
  2475. -        # Create an invalid libtool object if no PIC, so that we don't
  2476. -        # accidentally link it into a program.
  2477. -        $show "echo timestamp > $libobj"
  2478. -        $run eval "echo timestamp > $libobj" || exit $?
  2479. -        exit 0
  2480. +    # Create an invalid libtool object if no PIC, so that we don't
  2481. +    # accidentally link it into a program.
  2482. +    $show "echo timestamp > $libobj"
  2483. +    $run eval "echo timestamp > $libobj" || exit $?
  2484. +    exit 0
  2485.        fi
  2486.  
  2487.        if test -n "$pic_flag"; then
  2488. -        # Only do commands if we really have different PIC objects.
  2489. -        reload_objs="$libobjs"
  2490. -        output="$libobj"
  2491. -        cmds=`eval \\$echo \"$reload_cmds\"`
  2492. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  2493. -        for cmd in $cmds; do
  2494. -          IFS="$save_ifs"
  2495. -          $show "$cmd"
  2496. -          $run eval "$cmd" || exit $?
  2497. -        done
  2498. -        IFS="$save_ifs"
  2499. +    # Only do commands if we really have different PIC objects.
  2500. +    reload_objs="$libobjs"
  2501. +    output="$libobj"
  2502. +    eval cmds=\"$reload_cmds\"
  2503. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  2504. +    for cmd in $cmds; do
  2505. +      IFS="$save_ifs"
  2506. +      $show "$cmd"
  2507. +      $run eval "$cmd" || exit $?
  2508. +    done
  2509. +    IFS="$save_ifs"
  2510.        else
  2511. -        # Just create a symlink.
  2512. -        $show "$LN_S $obj $libobj"
  2513. -        $run $LN_S $obj $libobj || exit 1
  2514. +    # Just create a symlink.
  2515. +    $show $rm $libobj
  2516. +    $run $rm $libobj
  2517. +    $show "$LN_S $obj $libobj"
  2518. +    $run $LN_S $obj $libobj || exit $?
  2519.        fi
  2520.  
  2521.        exit 0
  2522.        ;;
  2523.  
  2524. +    # Anything else should be a program.
  2525.      *)
  2526.        if test -n "$vinfo"; then
  2527. -        $echo "$modename: warning: \`-version-info' is ignored while linking programs" 1>&2
  2528. +    $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
  2529.        fi
  2530.  
  2531. -      if test -n "$rpath"; then
  2532. -    # If the user specified any rpath flags, then add them.
  2533. -    for libdir in $rpath; do
  2534. -          if test -n "$hardcode_libdir_flag_spec"; then
  2535. -            if test -n "$hardcode_libdir_separator"; then
  2536. -              if test -z "$hardcode_libdirs"; then
  2537. -                # Put the magic libdir with the hardcode flag.
  2538. -                hardcode_libdirs="$libdir"
  2539. -                libdir="@HARDCODE_LIBDIRS@"
  2540. -              else
  2541. -                # Just accumulate the unique libdirs.
  2542. -        case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2543. -        *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2544. -          ;;
  2545. -        *)
  2546. -          hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2547. -          ;;
  2548. -        esac
  2549. -                libdir=
  2550. -              fi
  2551. -            fi
  2552. -
  2553. -            if test -n "$libdir"; then
  2554. -              flag=`eval \\$echo \"$hardcode_libdir_flag_spec\"`
  2555. -
  2556. -              compile_command="$compile_command $flag"
  2557. -              finalize_command="$finalize_command $flag"
  2558. -            fi
  2559. -          elif test "$hardcode_runpath_var" = yes; then
  2560. -            case "$perm_rpath " in
  2561. -            *" $libdir "*) ;;
  2562. -            *) perm_rpath="$perm_rpath $libdir" ;;
  2563. -            esac
  2564. -          fi
  2565. -    done
  2566. +      if test -n "$release"; then
  2567. +    $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
  2568.        fi
  2569.  
  2570. -      # Substitute the hardcoded libdirs into the compile commands.
  2571. -      if test -n "$hardcode_libdir_separator"; then
  2572. -    compile_command=`$echo "$compile_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2573. -    finalize_command=`$echo "$finalize_command" | sed "s%@HARDCODE_LIBDIRS@%$hardcode_libdirs%g"`
  2574. +      if test "$preload" = yes; then
  2575. +    if test "$dlopen" = unknown && test "$dlopen_self" = unknown &&
  2576. +       test "$dlopen_self_static" = unknown; then
  2577. +      $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
  2578. +    fi 
  2579. +      fi
  2580. +    
  2581. +      if test "$dlself" = yes && test "$export_dynamic" = no; then
  2582. +    $echo "$modename: error: \`-dlopen self' requires \`-export-dynamic'" 1>&2
  2583. +    exit 1
  2584.        fi
  2585.  
  2586. -      if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2587. -        # Transform all the library objects into standard objects.
  2588. -        compile_command=`$echo "$compile_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
  2589. -        finalize_command=`$echo "$finalize_command " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
  2590. +      if test -n "$rpath$xrpath"; then
  2591. +    # If the user specified any rpath flags, then add them.
  2592. +    for libdir in $rpath $xrpath; do
  2593. +      # This is the magic to use -rpath.
  2594. +      case "$compile_rpath " in
  2595. +      *" $libdir "*) ;;
  2596. +      *) compile_rpath="$compile_rpath $libdir" ;;
  2597. +      esac
  2598. +      case "$finalize_rpath " in
  2599. +      *" $libdir "*) ;;
  2600. +      *) finalize_rpath="$finalize_rpath $libdir" ;;
  2601. +      esac
  2602. +    done
  2603.        fi
  2604.  
  2605. -      if test "$export_dynamic" = yes && test -n "$NM" && test -n "$global_symbol_pipe"; then
  2606. -        dlsyms="${output}S.c"
  2607. +      # Now hardcode the library paths
  2608. +      rpath=
  2609. +      hardcode_libdirs=
  2610. +      for libdir in $compile_rpath $finalize_rpath; do
  2611. +    if test -n "$hardcode_libdir_flag_spec"; then
  2612. +      if test -n "$hardcode_libdir_separator"; then
  2613. +        if test -z "$hardcode_libdirs"; then
  2614. +          hardcode_libdirs="$libdir"
  2615. +        else
  2616. +          # Just accumulate the unique libdirs.
  2617. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2618. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2619. +        ;;
  2620. +          *)
  2621. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2622. +        ;;
  2623. +          esac
  2624. +        fi
  2625. +      else
  2626. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2627. +
  2628. +        rpath="$rpath $flag"
  2629. +      fi
  2630. +    elif test -n "$runpath_var"; then
  2631. +      case "$perm_rpath " in
  2632. +      *" $libdir "*) ;;
  2633. +      *) perm_rpath="$perm_rpath $libdir" ;;
  2634. +      esac
  2635. +    fi
  2636. +      done
  2637. +      # Substitute the hardcoded libdirs into the rpath.
  2638. +      if test -n "$hardcode_libdir_separator" &&
  2639. +     test -n "$hardcode_libdirs"; then
  2640. +    libdir="$hardcode_libdirs"
  2641. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2642. +      fi
  2643. +      compile_rpath="$rpath"
  2644. +
  2645. +      rpath=
  2646. +      hardcode_libdirs=
  2647. +      for libdir in $finalize_rpath; do
  2648. +    if test -n "$hardcode_libdir_flag_spec"; then
  2649. +      if test -n "$hardcode_libdir_separator"; then
  2650. +        if test -z "$hardcode_libdirs"; then
  2651. +          hardcode_libdirs="$libdir"
  2652. +        else
  2653. +          # Just accumulate the unique libdirs.
  2654. +          case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
  2655. +          *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
  2656. +        ;;
  2657. +          *)
  2658. +        hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
  2659. +        ;;
  2660. +          esac
  2661. +        fi
  2662. +      else
  2663. +        eval flag=\"$hardcode_libdir_flag_spec\"
  2664. +
  2665. +        rpath="$rpath $flag"
  2666. +      fi
  2667. +    elif test -n "$runpath_var"; then
  2668. +      case "$finalize_perm_rpath " in
  2669. +      *" $libdir "*) ;;
  2670. +      *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
  2671. +      esac
  2672. +    fi
  2673. +      done
  2674. +      # Substitute the hardcoded libdirs into the rpath.
  2675. +      if test -n "$hardcode_libdir_separator" &&
  2676. +     test -n "$hardcode_libdirs"; then
  2677. +    libdir="$hardcode_libdirs"
  2678. +    eval rpath=\" $hardcode_libdir_flag_spec\"
  2679. +      fi
  2680. +      finalize_rpath="$rpath"
  2681. +
  2682. +      output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
  2683. +      if test "X$output_objdir" = "X$output"; then
  2684. +    output_objdir="$objdir"
  2685.        else
  2686. -        dlsyms=
  2687. +    output_objdir="$output_objdir/$objdir"
  2688.        fi
  2689.  
  2690. -      if test -n "$dlsyms"; then
  2691. -        # Add our own program objects to the preloaded list.
  2692. -        dlprefiles=`$echo "$objs$dlprefiles " | sed -e 's/\.lo /.o /g' -e 's/ $//'`
  2693. -
  2694. -    # Discover the nlist of each of the dlfiles.
  2695. -        nlist="$objdir/${output}.nm"
  2696. +      if test -n "$libobjs" && test "$build_old_libs" = yes; then
  2697. +    # Transform all the library objects into standard objects.
  2698. +    compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2699. +    finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2700. +      fi
  2701.  
  2702. -    if test -d $objdir; then
  2703. -      $show "$rm $nlist ${nlist}T"
  2704. -      $run $rm "$nlist" "${nlist}T"
  2705. +      dlsyms=
  2706. +      if test -n "$dlfiles$dlprefiles" || test "$dlself" = yes; then
  2707. +    if test -n "$NM" && test -n "$global_symbol_pipe"; then
  2708. +      dlsyms="${outputname}S.c"
  2709.      else
  2710. -      $show "$mkdir $objdir"
  2711. -      $run $mkdir $objdir
  2712. -      status=$?
  2713. -      if test $status -eq 0 || test -d $objdir; then :
  2714. -      else
  2715. -        exit $status
  2716. -      fi
  2717. +      $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2718.      fi
  2719. +      fi
  2720.  
  2721. -        for arg in $dlprefiles; do
  2722. -      $show "extracting global C symbols from \`$arg'"
  2723. -      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2724. -        done
  2725. -
  2726. -        # Parse the name list into a source file.
  2727. -        $show "creating $objdir/$dlsyms"
  2728. -        if test -z "$run"; then
  2729. -      # Make sure we at least have an empty file.
  2730. -      test -f "$nlist" || : > "$nlist"
  2731. -
  2732. -      # Try sorting and uniquifying the output.
  2733. -      if sort "$nlist" | uniq > "$nlist"T; then
  2734. -        mv -f "$nlist"T "$nlist"
  2735. -        wcout=`wc "$nlist" 2>/dev/null`
  2736. -        count=`echo "$wcout" | sed 's/^[     ]*\([0-9][0-9]*\).*$/\1/'`
  2737. -        (test "$count" -ge 0) 2>/dev/null || count=-1
  2738. +      if test -n "$dlsyms"; then
  2739. +    case "$dlsyms" in
  2740. +    "") ;;
  2741. +    *.c)
  2742. +      # Discover the nlist of each of the dlfiles.
  2743. +      nlist="$objdir/${output}.nm"
  2744. +
  2745. +      if test -d $objdir; then
  2746. +        $show "$rm $nlist ${nlist}S ${nlist}T"
  2747. +        $run $rm "$nlist" "${nlist}S" "${nlist}T"
  2748.        else
  2749. -        $rm "$nlist"T
  2750. -        count=-1
  2751. +        $show "$mkdir $objdir"
  2752. +        $run $mkdir $objdir
  2753. +        status=$?
  2754. +        if test $status -ne 0 && test ! -d $objdir; then
  2755. +          exit $status
  2756. +        fi
  2757.        fi
  2758.  
  2759. -      case "$dlsyms" in
  2760. -      "") ;;
  2761. -      *.c)
  2762. -        cat <<EOF > "$objdir/$dlsyms"
  2763. -/* $dlsyms - symbol resolution table for \`$output' dlsym emulation. */
  2764. -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION */
  2765. +      # Parse the name list into a source file.
  2766. +      $show "creating $objdir/$dlsyms"
  2767. +
  2768. +      $echo > "$objdir/$dlsyms" "\
  2769. +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
  2770. +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
  2771.  
  2772.  #ifdef __cplusplus
  2773. -extern "C" {
  2774. +extern \"C\" {
  2775.  #endif
  2776.  
  2777.  /* Prevent the only kind of declaration conflicts we can make. */
  2778. -#define dld_preloaded_symbol_count some_other_symbol
  2779. -#define dld_preloaded_symbols some_other_symbol
  2780. +#define lt_preloaded_symbols some_other_symbol
  2781.  
  2782. -/* External symbol declarations for the compiler. */
  2783. -EOF
  2784. -        if test -f "$nlist"; then
  2785. -          sed -e 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> "$objdir/$dlsyms"
  2786. +/* External symbol declarations for the compiler. */\
  2787. +"
  2788. +
  2789. +      if test "$dlself" = yes; then
  2790. +        $show "generating symbol list for \`$output'"
  2791. +
  2792. +        echo ': @PROGRAM@ ' > "$nlist"
  2793. +
  2794. +        # Add our own program objects to the symbol list.
  2795. +        progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
  2796. +        for arg in $progfiles; do
  2797. +          $show "extracting global C symbols from \`$arg'"
  2798. +          $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2799. +        done
  2800. +
  2801. +        if test -n "$exclude_expsyms"; then
  2802. +          $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
  2803. +          $run eval '$mv "$nlist"T "$nlist"'
  2804. +        fi
  2805. +        
  2806. +        if test -n "$export_symbols_regex"; then
  2807. +          $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
  2808. +          $run eval '$mv "$nlist"T "$nlist"'
  2809. +        fi
  2810. +
  2811. +        # Prepare the list of exported symbols
  2812. +        if test -z "$export_symbols"; then
  2813. +          export_symbols="$objdir/$output.exp"
  2814. +          $run $rm $export_symbols
  2815. +          $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
  2816.          else
  2817. -          echo '/* NONE */' >> "$objdir/$dlsyms"
  2818. -EOF
  2819. +          $run $rm $export_symbols
  2820. +          $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$objdir/$output.exp"'
  2821. +          $run eval 'grep -f "$objdir/$output.exp" < "$nlist" > "$nlist"T'
  2822. +          $run eval 'mv "$nlist"T "$nlist"'
  2823. +        fi
  2824. +      fi
  2825. +
  2826. +      for arg in $dlprefiles; do
  2827. +        $show "extracting global C symbols from \`$arg'"
  2828. +        name=`echo "$arg" | sed -e 's%^.*/%%'`
  2829. +        $run eval 'echo ": $name " >> "$nlist"'
  2830. +        $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
  2831. +      done
  2832. +
  2833. +      if test -z "$run"; then
  2834. +        # Make sure we have at least an empty file.
  2835. +        test -f "$nlist" || : > "$nlist"
  2836. +
  2837. +        if test -n "$exclude_expsyms"; then
  2838. +          egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
  2839. +          $mv "$nlist"T "$nlist"
  2840. +        fi
  2841. +
  2842. +        # Try sorting and uniquifying the output.
  2843. +        if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
  2844. +          :
  2845. +        else
  2846. +          grep -v "^: " < "$nlist" > "$nlist"S
  2847. +        fi
  2848. +
  2849. +        if test -f "$nlist"S; then
  2850. +          eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
  2851. +        else
  2852. +          echo '/* NONE */' >> "$output_objdir/$dlsyms"
  2853.          fi
  2854.  
  2855. -        cat <<EOF >> "$objdir/$dlsyms"
  2856. +        $echo >> "$output_objdir/$dlsyms" "\
  2857.  
  2858. -#undef dld_preloaded_symbol_count
  2859. -#undef dld_preloaded_symbols
  2860. +#undef lt_preloaded_symbols
  2861.  
  2862.  #if defined (__STDC__) && __STDC__
  2863. -# define __ptr_t void *
  2864. +# define lt_ptr_t void *
  2865.  #else
  2866. -# define __ptr_t char *
  2867. +# define lt_ptr_t char *
  2868. +# define const
  2869.  #endif
  2870.  
  2871. -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  2872. -int dld_preloaded_symbol_count = $count;
  2873. -
  2874.  /* The mapping between symbol names and symbols. */
  2875. -struct {
  2876. -  char *name;
  2877. -  __ptr_t address;
  2878. +const struct {
  2879. +  const char *name;
  2880. +  lt_ptr_t address;
  2881.  }
  2882. -dld_preloaded_symbols[] =
  2883. -{
  2884. -EOF
  2885. -
  2886. -        if test -f "$nlist"; then
  2887. -          sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> "$objdir/$dlsyms"
  2888. -        fi
  2889. +lt_preloaded_symbols[] =
  2890. +{\
  2891. +"
  2892. +
  2893. +        sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
  2894. +        -e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
  2895. +          < "$nlist" >> "$output_objdir/$dlsyms"
  2896.  
  2897. -        cat <<\EOF >> "$objdir/$dlsyms"
  2898. -  {0},
  2899. +        $echo >> "$output_objdir/$dlsyms" "\
  2900. +  {0, (lt_ptr_t) 0}
  2901.  };
  2902.  
  2903. -#ifdef __cplusplus
  2904. +/* This works around a problem in FreeBSD linker */
  2905. +#ifdef FREEBSD_WORKAROUND
  2906. +static const void *lt_preloaded_setup() {
  2907. +  return lt_preloaded_symbols;
  2908.  }
  2909.  #endif
  2910. -EOF
  2911. -        ;;
  2912.  
  2913. -      *)
  2914. -        $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2915. -        exit 1
  2916. -        ;;
  2917. +#ifdef __cplusplus
  2918. +}
  2919. +#endif\
  2920. +"
  2921. +      fi
  2922. +
  2923. +      pic_flag_for_symtable=
  2924. +          case "$host" in
  2925. +      # compiling the symbol table file with pic_flag works around
  2926. +      # a FreeBSD bug that causes programs to crash when -lm is
  2927. +      # linked before any other PIC object.  But we must not use
  2928. +      # pic_flag when linking with -static.  The problem exists in
  2929. +      # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
  2930. +      *-*-freebsd2*|*-*-freebsd3.0*)
  2931. +        case "$compile_command " in
  2932. +        *" -static "*) ;;
  2933. +        *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";;
  2934. +        esac
  2935.        esac
  2936. -        fi
  2937.  
  2938. -        # Now compile the dynamic symbol file.
  2939. -        $show "(cd $objdir && $CC -c$no_builtin_flag \"$dlsyms\")"
  2940. -        $run eval '(cd $objdir && $CC -c$no_builtin_flag "$dlsyms")' || exit $?
  2941. -
  2942. -        # Transform the symbol file into the correct name.
  2943. -        compile_command=`$echo "$compile_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
  2944. -        finalize_command=`$echo "$finalize_command" | sed "s%@SYMFILE@%$objdir/${output}S.o%"`
  2945. -      elif test "$export_dynamic" != yes; then
  2946. -        test -n "$dlfiles$dlprefiles" && $echo "$modename: warning: \`-dlopen' and \`-dlpreopen' are ignored without \`-export-dynamic'" 1>&2
  2947. +      # Now compile the dynamic symbol file.
  2948. +      $show "(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
  2949. +      $run eval '(cd $objdir && $C_compiler -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
  2950. +
  2951. +      # Transform the symbol file into the correct name.
  2952. +      compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  2953. +      finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$objdir/${output}S.${objext}%"`
  2954. +      ;;
  2955. +    *)
  2956. +      $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
  2957. +      exit 1
  2958. +      ;;
  2959. +    esac
  2960.        else
  2961. -        # We keep going just in case the user didn't refer to
  2962. -        # dld_preloaded_symbols.  The linker will fail if global_symbol_pipe
  2963. -        # really was required.
  2964. -        $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
  2965. -
  2966. -        # Nullify the symbol file.
  2967. -        compile_command=`$echo "$compile_command" | sed "s% @SYMFILE@%%"`
  2968. -        finalize_command=`$echo "$finalize_command" | sed "s% @SYMFILE@%%"`
  2969. +    # We keep going just in case the user didn't refer to
  2970. +    # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
  2971. +    # really was required.
  2972. +
  2973. +    # Nullify the symbol file.
  2974. +    compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
  2975. +    finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
  2976.        fi
  2977.  
  2978.        if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then
  2979. -        # Replace the output file specification.
  2980. -        compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$output"'%g'`
  2981. -        finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$output"'%g'`
  2982. -
  2983. -        # We have no uninstalled library dependencies, so finalize right now.
  2984. -        $show "$compile_command"
  2985. -        $run eval "$compile_command"
  2986. -        exit $?
  2987. +    # Replace the output file specification.
  2988. +    compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
  2989. +    link_command="$compile_command$compile_rpath"
  2990. +
  2991. +    # We have no uninstalled library dependencies, so finalize right now.
  2992. +    $show "$link_command"
  2993. +    $run eval "$link_command"
  2994. +    exit $?
  2995.        fi
  2996.  
  2997. -      # Replace the output file specification.
  2998. -      compile_command=`$echo "$compile_command" | sed 's%@OUTPUT@%'"$objdir/$output"'%g'`
  2999. -      finalize_command=`$echo "$finalize_command" | sed 's%@OUTPUT@%'"$objdir/$output"'T%g'`
  3000. -
  3001. -      # Create the binary in the object directory, then wrap it.
  3002. -      if test -d $objdir; then :
  3003. -      else
  3004. -        $show "$mkdir $objdir"
  3005. -        $run $mkdir $objdir || exit $?
  3006. +      if test -n "$shlibpath_var"; then
  3007. +    # We should set the shlibpath_var
  3008. +    rpath=
  3009. +    for dir in $temp_rpath; do
  3010. +      case "$dir" in
  3011. +      /* | [A-Za-z]:[/\\]*)
  3012. +        # Absolute path.
  3013. +        rpath="$rpath$dir:"
  3014. +        ;;
  3015. +      *)
  3016. +        # Relative path: add a thisdir entry.
  3017. +        rpath="$rpath\$thisdir/$dir:"
  3018. +        ;;
  3019. +      esac
  3020. +    done
  3021. +    temp_rpath="$rpath"
  3022.        fi
  3023.  
  3024. -      if test -n "$shlibpath_var"; then
  3025. -        # We should set the shlibpath_var
  3026. -        rpath=
  3027. -        for dir in $temp_rpath; do
  3028. -          case "$dir" in
  3029. -          /*)
  3030. -            # Absolute path.
  3031. -            rpath="$rpath$dir:"
  3032. -            ;;
  3033. -          *)
  3034. -            # Relative path: add a thisdir entry.
  3035. -            rpath="$rpath\$thisdir/$dir:"
  3036. -            ;;
  3037. -          esac
  3038. -        done
  3039. -        temp_rpath="$rpath"
  3040. +      if test -n "$compile_shlibpath$finalize_shlibpath"; then
  3041. +    compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
  3042. +      fi
  3043. +      if test -n "$finalize_shlibpath"; then
  3044. +    finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3045.        fi
  3046.  
  3047. -      # Delete the old output file.
  3048. -      $run $rm $output
  3049. +      compile_var=
  3050. +      finalize_var=
  3051. +      if test -n "$runpath_var"; then
  3052. +    if test -n "$perm_rpath"; then
  3053. +      # We should set the runpath_var.
  3054. +      rpath=
  3055. +      for dir in $perm_rpath; do
  3056. +        rpath="$rpath$dir:"
  3057. +      done
  3058. +      compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3059. +    fi
  3060. +    if test -n "$finalize_perm_rpath"; then
  3061. +      # We should set the runpath_var.
  3062. +      rpath=
  3063. +      for dir in $finalize_perm_rpath; do
  3064. +        rpath="$rpath$dir:"
  3065. +      done
  3066. +      finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
  3067. +    fi
  3068. +      fi
  3069.  
  3070. -      if test -n "$compile_shlibpath"; then
  3071. -        compile_command="$shlibpath_var=\"$compile_shlibpath\$$shlibpath_var\" $compile_command"
  3072. +      if test "$hardcode_action" = relink; then
  3073. +    # Fast installation is not supported
  3074. +    link_command="$compile_var$compile_command$compile_rpath"
  3075. +    relink_command="$finalize_var$finalize_command$finalize_rpath"
  3076. +    
  3077. +    # AGH! Flame the AIX and HP-UX people for me, will ya?
  3078. +    $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
  3079. +    $echo "$modename: \`$output' will be relinked during installation" 1>&2
  3080. +      else
  3081. +    if test "$fast_install" != no; then
  3082. +      link_command="$finalize_var$compile_command$finalize_rpath"
  3083. +      if test "$fast_install" = yes; then
  3084. +        relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
  3085. +      else
  3086. +        # fast_install is set to needless
  3087. +        relink_command=
  3088. +      fi
  3089. +    else
  3090. +      link_command="$compile_var$compile_command$compile_rpath"
  3091. +      relink_command="$finalize_var$finalize_command$finalize_rpath"
  3092. +    fi
  3093.        fi
  3094. -      if test -n "$finalize_shlibpath"; then
  3095. -        finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
  3096. +
  3097. +      # Replace the output file specification.
  3098. +      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
  3099. +      
  3100. +      # Create the binary in the object directory, then wrap it.
  3101. +      if test ! -d $output_objdir; then
  3102. +    $show "$mkdir $output_objdir"
  3103. +    $run $mkdir $output_objdir
  3104. +    status=$?
  3105. +    if test $status -ne 0 && test ! -d $objdir; then
  3106. +      exit $status
  3107. +    fi
  3108.        fi
  3109.  
  3110. -      if test -n "$perm_rpath"; then
  3111. -        # We should set the runpath_var.
  3112. -        rpath=
  3113. -        for dir in $perm_rpath; do
  3114. -          rpath="$rpath$dir:"
  3115. -        done
  3116. -        compile_command="$runpath_var=\"$rpath\$$runpath_var\" $compile_command"
  3117. -        finalize_command="$runpath_var=\"$rpath\$$runpath_var\" $finalize_command"
  3118. -      fi
  3119. -
  3120. -      case "$hardcode_action" in
  3121. -      relink)
  3122. -        # AGH! Flame the AIX and HP-UX people for me, will ya?
  3123. -        $echo "$modename: warning: using a buggy system linker" 1>&2
  3124. -        $echo "$modename: relinking will be required before \`$output' can be installed" 1>&2
  3125. -        ;;
  3126. -      esac
  3127. +      # Delete the old output file.
  3128. +      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
  3129.  
  3130. -      $show "$compile_command"
  3131. -      $run eval "$compile_command" || exit $?
  3132. +      $show "$link_command"
  3133. +      $run eval "$link_command" || exit $?
  3134.  
  3135.        # Now create the wrapper script.
  3136.        $show "creating $output"
  3137.  
  3138. -      # Quote the finalize command for shipping.
  3139. -      finalize_command=`$echo "$finalize_command" | sed "$sed_quote_subst"`
  3140. +      # Quote the relink command for shipping.
  3141. +      if test -n "$relink_command"; then
  3142. +    relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
  3143. +      fi
  3144. +
  3145. +      # Quote $echo for shipping.
  3146. +      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
  3147. +    case "$0" in
  3148. +    /* | [A-Za-z]:[/\\]*) qecho="$SHELL $0 --fallback-echo";;
  3149. +    *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
  3150. +    esac
  3151. +    qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
  3152. +      else
  3153. +    qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
  3154. +      fi
  3155.  
  3156.        # Only actually do things if our run command is non-null.
  3157.        if test -z "$run"; then
  3158. -        $rm $output
  3159. -        trap "$rm $output; exit 1" 1 2 15
  3160. +    # win32 will think the script is a binary if it has
  3161. +    # a .exe suffix, so we strip it off here.
  3162. +    case $output in
  3163. +      *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
  3164. +    esac
  3165. +    $rm $output
  3166. +    trap "$rm $output; exit 1" 1 2 15
  3167.  
  3168. -        cat > $output <<EOF
  3169. -#! /bin/sh
  3170. +    $echo > $output "\
  3171. +#! $SHELL
  3172.  
  3173. -# $output - temporary wrapper script for $objdir/$output
  3174. -# Generated by ltmain.sh - GNU $PACKAGE $VERSION
  3175. +# $output - temporary wrapper script for $objdir/$outputname
  3176. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3177.  #
  3178.  # The $output program cannot be directly executed until all the libtool
  3179.  # libraries that it depends on are installed.
  3180.  #
  3181. -# This wrapper script should never be moved out of \``pwd`'.
  3182. +# This wrapper script should never be moved out of the build directory.
  3183.  # If it is, it will not operate correctly.
  3184.  
  3185. +# Sed substitution that helps us do robust quoting.  It backslashifies
  3186. +# metacharacters that are still active within double-quoted strings.
  3187. +Xsed='sed -e 1s/^X//'
  3188. +sed_quote_subst='$sed_quote_subst'
  3189. +
  3190. +# The HP-UX ksh and POSIX shell print the target directory to stdout
  3191. +# if CDPATH is set.
  3192. +if test \"\${CDPATH+set}\" = set; then CDPATH=; export CDPATH; fi
  3193. +
  3194. +relink_command=\"$relink_command\"
  3195. +
  3196.  # This environment variable determines our operation mode.
  3197. -if test "\$libtool_install_magic" = "$magic"; then
  3198. -  # install mode needs the following variables:
  3199. +if test \"\$libtool_install_magic\" = \"$magic\"; then
  3200. +  # install mode needs the following variable:
  3201.    link_against_libtool_libs='$link_against_libtool_libs'
  3202. -  finalize_command="$finalize_command"
  3203.  else
  3204.    # When we are sourced in execute mode, \$file and \$echo are already set.
  3205. -  if test "\$libtool_execute_magic" = "$magic"; then :
  3206. -  else
  3207. -    echo='$echo'
  3208. -    file="\$0"
  3209. -  fi
  3210. +  if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3211. +    echo=\"$qecho\"
  3212. +    file=\"\$0\"
  3213. +    # Make sure echo works.
  3214. +    if test \"X\$1\" = X--no-reexec; then
  3215. +      # Discard the --no-reexec flag, and continue.
  3216. +      shift
  3217. +    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
  3218. +      # Yippee, \$echo works!
  3219. +      :
  3220. +    else
  3221. +      # Restart under the correct shell, and then maybe \$echo will work.
  3222. +      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
  3223. +    fi
  3224. +  fi\
  3225. +"
  3226. +    $echo >> $output "\
  3227.  
  3228.    # Find the directory that this script lives in.
  3229. -  thisdir=\`\$echo "\$file" | sed 's%/[^/]*$%%'\`
  3230. -  test "x\$thisdir" = "x\$file" && thisdir=.
  3231. +  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
  3232. +  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
  3233.  
  3234.    # Follow symbolic links until we get to the real thisdir.
  3235. -  file=\`ls -ld "\$file" | sed -n 's/.*-> //p'\`
  3236. -  while test -n "\$file"; do
  3237. -    destdir=\`\$echo "\$file" | sed 's%/[^/]*\$%%'\`
  3238. +  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
  3239. +  while test -n \"\$file\"; do
  3240. +    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
  3241.  
  3242.      # If there was a directory component, then change thisdir.
  3243. -    if test "x\$destdir" != "x\$file"; then
  3244. -      case "\$destdir" in
  3245. -      /*) thisdir="\$destdir" ;;
  3246. -      *) thisdir="\$thisdir/\$destdir" ;;
  3247. +    if test \"x\$destdir\" != \"x\$file\"; then
  3248. +      case \"\$destdir\" in
  3249. +      /* | [A-Za-z]:[/\\]*) thisdir=\"\$destdir\" ;;
  3250. +      *) thisdir=\"\$thisdir/\$destdir\" ;;
  3251.        esac
  3252.      fi
  3253.  
  3254. -    file=\`\$echo "\$file" | sed 's%^.*/%%'\`
  3255. -    file=\`ls -ld "\$thisdir/\$file" | sed -n 's/.*-> //p'\`
  3256. +    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
  3257. +    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
  3258.    done
  3259.  
  3260.    # Try to get the absolute directory name.
  3261. -  absdir=\`cd "\$thisdir" && pwd\`
  3262. -  test -n "\$absdir" && thisdir="\$absdir"
  3263. +  absdir=\`cd \"\$thisdir\" && pwd\`
  3264. +  test -n \"\$absdir\" && thisdir=\"\$absdir\"
  3265. +"
  3266. +
  3267. +    if test "$fast_install" = yes; then
  3268. +      echo >> $output "\
  3269. +  program=lt-'$outputname'
  3270. +  progdir=\"\$thisdir/$objdir\"
  3271. +  
  3272. +  if test ! -f \"\$progdir/\$program\" || \\
  3273. +     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
  3274. +       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
  3275.  
  3276. -  progdir="\$thisdir/$objdir"
  3277. -  program='$output'
  3278. +    file=\"\$\$-\$program\"
  3279.  
  3280. -  if test -f "\$progdir/\$program"; then
  3281. -EOF
  3282. +    if test ! -d \"\$progdir\"; then
  3283. +      $mkdir \"\$progdir\"
  3284. +    else
  3285. +      $rm \"\$progdir/\$file\"
  3286. +    fi"
  3287.  
  3288. -        # Export our shlibpath_var if we have one.
  3289. -        if test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3290. -          cat >> $output <<EOF
  3291. +      echo >> $output "\
  3292. +
  3293. +    # relink executable if necessary
  3294. +    if test -n \"\$relink_command\"; then
  3295. +      if (cd \"\$thisdir\" && eval \$relink_command); then :
  3296. +      else
  3297. +    $rm \"\$progdir/\$file\"
  3298. +    exit 1
  3299. +      fi
  3300. +    fi
  3301. +
  3302. +    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
  3303. +    { $rm \"\$progdir/\$program\";
  3304. +      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
  3305. +    $rm \"\$progdir/\$file\"
  3306. +  fi"
  3307. +    else
  3308. +      echo >> $output "\
  3309. +  program='$outputname'
  3310. +  progdir=\"\$thisdir/$objdir\"
  3311. +"
  3312. +    fi
  3313. +
  3314. +    echo >> $output "\
  3315. +
  3316. +  if test -f \"\$progdir/\$program\"; then"
  3317. +
  3318. +    # Export our shlibpath_var if we have one.
  3319. +    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
  3320. +      $echo >> $output "\
  3321.      # Add our own library path to $shlibpath_var
  3322. -    $shlibpath_var="$temp_rpath\$$shlibpath_var"
  3323. +    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
  3324.  
  3325.      # Some systems cannot cope with colon-terminated $shlibpath_var
  3326. -    $shlibpath_var=\`\$echo \$$shlibpath_var | sed -e 's/:*\$//'\`
  3327. +    # The second colon is a workaround for a bug in BeOS R4 sed
  3328. +    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
  3329.  
  3330.      export $shlibpath_var
  3331. +"
  3332. +    fi
  3333.  
  3334. -EOF
  3335. -        fi
  3336. +    # fixup the dll searchpath if we need to.
  3337. +    if test -n "$dllsearchpath"; then
  3338. +      $echo >> $output "\
  3339. +    # Add the dll search path components to the executable PATH
  3340. +    PATH=$dllsearchpath:\$PATH
  3341. +"
  3342. +    fi
  3343.  
  3344. -        cat >> $output <<EOF
  3345. -    if test "\$libtool_execute_magic" != "$magic"; then
  3346. +    $echo >> $output "\
  3347. +    if test \"\$libtool_execute_magic\" != \"$magic\"; then
  3348.        # Run the actual program with our arguments.
  3349. -      args=
  3350. -      for arg
  3351. -      do
  3352. -        # Quote arguments (to preserve shell metacharacters).
  3353. -    sed_quote_subst='$sed_quote_subst'
  3354. -    arg=\`\$echo "\$arg" | sed "\$sed_quote_subst"\`
  3355. -        args="\$args \\"\$arg\\""
  3356. -      done
  3357. -
  3358. +"
  3359. +    case $host in
  3360. +    *-*-cygwin* | *-*-mingw | *-*-os2*)
  3361. +      # win32 systems need to use the prog path for dll
  3362. +      # lookup to work
  3363. +      $echo >> $output "\
  3364. +      exec \$progdir\\\\\$program \${1+\"\$@\"}
  3365. +"
  3366. +      ;;
  3367. +    *)
  3368. +      $echo >> $output "\
  3369.        # Export the path to the program.
  3370. -      PATH="\$progdir:\$PATH"
  3371. +      PATH=\"\$progdir:\$PATH\"
  3372.        export PATH
  3373.  
  3374. -      eval "exec \$program \$args"
  3375. -
  3376. -      \$echo "\$0: cannot exec \$program \$args"
  3377. +      exec \$program \${1+\"\$@\"}
  3378. +"
  3379. +      ;;
  3380. +    esac
  3381. +    $echo >> $output "\
  3382. +      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
  3383.        exit 1
  3384.      fi
  3385.    else
  3386.      # The program doesn't exist.
  3387. -    \$echo "\$0: error: \$progdir/\$program does not exist" 1>&2
  3388. -    \$echo "This script is just a wrapper for \$program." 1>&2
  3389. -    echo "See the $PACKAGE documentation for more information." 1>&2
  3390. +    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
  3391. +    \$echo \"This script is just a wrapper for \$program.\" 1>&2
  3392. +    echo \"See the $PACKAGE documentation for more information.\" 1>&2
  3393.      exit 1
  3394.    fi
  3395. -fi
  3396. -EOF
  3397. -        chmod +x $output
  3398. +fi\
  3399. +"
  3400. +    chmod +x $output
  3401.        fi
  3402.        exit 0
  3403.        ;;
  3404.      esac
  3405.  
  3406. -
  3407.      # See if we need to build an old-fashioned archive.
  3408. -    if test "$build_old_libs" = "yes"; then
  3409. -      # Now set the variables for building old libraries.
  3410. -      oldlib="$objdir/$libname.a"
  3411. +    for oldlib in $oldlibs; do
  3412.  
  3413. -      # Transform .lo files to .o files.
  3414. -      oldobjs="$objs"`$echo "$libobjs " | sed -e 's/[^   ]*\.a //g' -e 's/\.lo /.o /g' -e 's/ $//g'`
  3415. -
  3416. -      if test -d "$objdir"; then
  3417. -        $show "$rm $oldlib"
  3418. -        $run $rm $oldlib
  3419. +      if test "$build_libtool_libs" = convenience; then
  3420. +    oldobjs="$libobjs_save"
  3421. +    addlibs="$convenience"
  3422. +    build_libtool_libs=no
  3423.        else
  3424. -        $show "$mkdir $objdir"
  3425. -        $run $mkdir $objdir
  3426. +    if test "$build_libtool_libs" = module; then
  3427. +      oldobjs="$libobjs_save"
  3428. +      build_libtool_libs=no
  3429. +    else
  3430. +      oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`
  3431. +    fi
  3432. +    addlibs="$old_convenience"
  3433.        fi
  3434.  
  3435. +      # Add in members from convenience archives.
  3436. +      for xlib in $addlibs; do
  3437. +    # Extract the objects.
  3438. +    xdir="$xlib"x
  3439. +    generated="$generated $xdir"
  3440. +    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
  3441. +
  3442. +    $show "${rm}r $xdir"
  3443. +    $run ${rm}r "$xdir"
  3444. +    $show "mkdir $xdir"
  3445. +    $run mkdir "$xdir"
  3446. +    status=$?
  3447. +    if test $status -ne 0 && test ! -d "$xdir"; then
  3448. +      exit $status
  3449. +    fi
  3450. +    $show "(cd $xdir && $AR x ../$xlib)"
  3451. +    $run eval "(cd \$xdir && $AR x ../\$xlib)" || exit $?
  3452. +
  3453. +    oldobjs="$oldobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP`
  3454. +      done
  3455. +
  3456.        # Do each command in the archive commands.
  3457.        if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
  3458. -    cmds=`eval \\$echo \"$old_archive_from_new_cmds\"`
  3459. +    eval cmds=\"$old_archive_from_new_cmds\"
  3460.        else
  3461. -    cmds=`eval \\$echo \"$old_archive_cmds\"`
  3462. +    eval cmds=\"$old_archive_cmds\"
  3463.        fi
  3464. -      IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  3465. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3466.        for cmd in $cmds; do
  3467. -        IFS="$save_ifs"
  3468. -        $show "$cmd"
  3469. -        $run eval "$cmd" || exit $?
  3470. +    IFS="$save_ifs"
  3471. +    $show "$cmd"
  3472. +    $run eval "$cmd" || exit $?
  3473.        done
  3474.        IFS="$save_ifs"
  3475. +    done
  3476. +
  3477. +    if test -n "$generated"; then
  3478. +      $show "${rm}r$generated"
  3479. +      $run ${rm}r$generated
  3480.      fi
  3481.  
  3482.      # Now create the libtool archive.
  3483.      case "$output" in
  3484.      *.la)
  3485.        old_library=
  3486. -      test "$build_old_libs" = yes && old_library="$libname.a"
  3487. -
  3488. +      test "$build_old_libs" = yes && old_library="$libname.$libext"
  3489.        $show "creating $output"
  3490.  
  3491. +      if test -n "$xrpath"; then
  3492. +    temp_xrpath=
  3493. +    for libdir in $xrpath; do
  3494. +      temp_xrpath="$temp_xrpath -R$libdir"
  3495. +    done
  3496. +    dependency_libs="$temp_xrpath $dependency_libs"
  3497. +      fi
  3498. +
  3499.        # Only create the output if not a dry run.
  3500.        if test -z "$run"; then
  3501. -        cat > $output <<EOF
  3502. +    $echo > $output "\
  3503.  # $output - a libtool library file
  3504. -# Generated by ltmain.sh - GNU $PACKAGE $VERSION
  3505. +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
  3506.  
  3507.  # The name that we can dlopen(3).
  3508.  dlname='$dlname'
  3509. @@ -1523,20 +2858,30 @@
  3510.  # The name of the static archive.
  3511.  old_library='$old_library'
  3512.  
  3513. +# Libraries that this one depends upon.
  3514. +dependency_libs='$dependency_libs'
  3515. +
  3516.  # Version information for $libname.
  3517.  current=$current
  3518.  age=$age
  3519.  revision=$revision
  3520.  
  3521. +# Is this an already installed library?
  3522. +installed=no
  3523. +
  3524.  # Directory that this library needs to be installed in:
  3525. -libdir='$install_libdir'
  3526. -EOF
  3527. +libdir='$install_libdir'\
  3528. +"
  3529. +
  3530. +    $rm "$output_objdir/$outputname"i
  3531. +    sed 's/^installed=no$/installed=yes/' \
  3532. +      < "$output" > "$output_objdir/$outputname"i || exit 1
  3533.        fi
  3534.  
  3535.        # Do a symbolic link so that the libtool archive can be found in
  3536.        # LD_LIBRARY_PATH before the program is installed.
  3537. -      $show "(cd $objdir && $LN_S ../$output $output)"
  3538. -      $run eval "(cd $objdir && $LN_S ../$output $output)" || exit 1
  3539. +      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
  3540. +      $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $?
  3541.        ;;
  3542.      esac
  3543.      exit 0
  3544. @@ -1546,11 +2891,11 @@
  3545.    install)
  3546.      modename="$modename: install"
  3547.  
  3548. -    # There may be an optional /bin/sh argument at the beginning of
  3549. +    # There may be an optional sh(1) argument at the beginning of
  3550.      # install_prog (especially on Windows NT).
  3551. -    if test "$nonopt" = "$SHELL"; then
  3552. +    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then
  3553.        # Aesthetically quote it.
  3554. -      arg=`$echo "$nonopt" | sed "$sed_quote_subst"`
  3555. +      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
  3556.        case "$arg" in
  3557.        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3558.      arg="\"$arg\""
  3559. @@ -1566,7 +2911,7 @@
  3560.  
  3561.      # The real first argument should be the name of the installation program.
  3562.      # Aesthetically quote it.
  3563. -    arg=`$echo "$arg" | sed "$sed_quote_subst"`
  3564. +    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3565.      case "$arg" in
  3566.      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3567.        arg="\"$arg\""
  3568. @@ -1580,14 +2925,14 @@
  3569.      opts=
  3570.      prev=
  3571.      install_type=
  3572. -    isdir=
  3573. +    isdir=no
  3574.      stripme=
  3575.      for arg
  3576.      do
  3577.        if test -n "$dest"; then
  3578. -        files="$files $dest"
  3579. -        dest="$arg"
  3580. -        continue
  3581. +    files="$files $dest"
  3582. +    dest="$arg"
  3583. +    continue
  3584.        fi
  3585.  
  3586.        case "$arg" in
  3587. @@ -1597,24 +2942,24 @@
  3588.        -m) prev="-m" ;;
  3589.        -o) prev="-o" ;;
  3590.        -s)
  3591. -        stripme=" -s"
  3592. -        continue
  3593. -        ;;
  3594. +    stripme=" -s"
  3595. +    continue
  3596. +    ;;
  3597.        -*) ;;
  3598.  
  3599.        *)
  3600. -        # If the previous option needed an argument, then skip it.
  3601. -        if test -n "$prev"; then
  3602. -          prev=
  3603. -        else
  3604. -          dest="$arg"
  3605. -          continue
  3606. -        fi
  3607. -        ;;
  3608. +    # If the previous option needed an argument, then skip it.
  3609. +    if test -n "$prev"; then
  3610. +      prev=
  3611. +    else
  3612. +      dest="$arg"
  3613. +      continue
  3614. +    fi
  3615. +    ;;
  3616.        esac
  3617.  
  3618.        # Aesthetically quote the argument.
  3619. -      arg=`$echo "$arg" | sed "$sed_quote_subst"`
  3620. +      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
  3621.        case "$arg" in
  3622.        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*)
  3623.      arg="\"$arg\""
  3624. @@ -1637,47 +2982,47 @@
  3625.  
  3626.      if test -z "$files"; then
  3627.        if test -z "$dest"; then
  3628. -        $echo "$modename: no file or destination specified" 1>&2
  3629. +    $echo "$modename: no file or destination specified" 1>&2
  3630.        else
  3631. -        $echo "$modename: you must specify a destination" 1>&2
  3632. +    $echo "$modename: you must specify a destination" 1>&2
  3633.        fi
  3634.        $echo "$help" 1>&2
  3635.        exit 1
  3636.      fi
  3637.  
  3638.      # Strip any trailing slash from the destination.
  3639. -    dest=`$echo "$dest" | sed 's%/$%%'`
  3640. +    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
  3641.  
  3642.      # Check to see that the destination is a directory.
  3643.      test -d "$dest" && isdir=yes
  3644. -    if test -n "$isdir"; then
  3645. +    if test "$isdir" = yes; then
  3646.        destdir="$dest"
  3647.        destname=
  3648.      else
  3649. -      destdir=`$echo "$dest" | sed 's%/[^/]*$%%'`
  3650. +      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
  3651.        test "X$destdir" = "X$dest" && destdir=.
  3652. -      destname=`$echo "$dest" | sed 's%^.*/%%'`
  3653. +      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
  3654.  
  3655.        # Not a directory, so check to see that there is only one file specified.
  3656.        set dummy $files
  3657.        if test $# -gt 2; then
  3658. -        $echo "$modename: \`$dest' is not a directory" 1>&2
  3659. -        $echo "$help" 1>&2
  3660. -        exit 1
  3661. +    $echo "$modename: \`$dest' is not a directory" 1>&2
  3662. +    $echo "$help" 1>&2
  3663. +    exit 1
  3664.        fi
  3665.      fi
  3666.      case "$destdir" in
  3667. -    /*) ;;
  3668. +    /* | [A-Za-z]:[/\\]*) ;;
  3669.      *)
  3670.        for file in $files; do
  3671. -        case "$file" in
  3672. -        *.lo) ;;
  3673. -        *)
  3674. -          $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3675. -          $echo "$help" 1>&2
  3676. -          exit 1
  3677. -          ;;
  3678. -        esac
  3679. +    case "$file" in
  3680. +    *.lo) ;;
  3681. +    *)
  3682. +      $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
  3683. +      $echo "$help" 1>&2
  3684. +      exit 1
  3685. +      ;;
  3686. +    esac
  3687.        done
  3688.        ;;
  3689.      esac
  3690. @@ -1693,224 +3038,225 @@
  3691.  
  3692.        # Do each installation.
  3693.        case "$file" in
  3694. -      *.a)
  3695. -        # Do the static libraries later.
  3696. -        staticlibs="$staticlibs $file"
  3697. -        ;;
  3698. +      *.a | *.lib)
  3699. +    # Do the static libraries later.
  3700. +    staticlibs="$staticlibs $file"
  3701. +    ;;
  3702.  
  3703.        *.la)
  3704. -        # Check to see that this really is a libtool archive.
  3705. -        if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
  3706. -        else
  3707. -          $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3708. -          $echo "$help" 1>&2
  3709. -          exit 1
  3710. -        fi
  3711. -
  3712. -        library_names=
  3713. -        old_library=
  3714. -        # If there is no directory component, then add one.
  3715. -        case "$file" in
  3716. -        */*) . $file ;;
  3717. -        *) . ./$file ;;
  3718. -        esac
  3719. -
  3720. -        # Add the libdir to current_libdirs if it is the destination.
  3721. -        if test "X$destdir" = "X$libdir"; then
  3722. -          case "$current_libdirs " in
  3723. -          *" $libdir "*) ;;
  3724. -          *) current_libdirs="$current_libdirs $libdir" ;;
  3725. -          esac
  3726. -        else
  3727. -          # Note the libdir as a future libdir.
  3728. -          case "$future_libdirs " in
  3729. -          *" $libdir "*) ;;
  3730. -          *) future_libdirs="$future_libdirs $libdir" ;;
  3731. -          esac
  3732. -        fi
  3733. -
  3734. -        dir="`$echo "$file" | sed 's%/[^/]*$%%'`/"
  3735. -        test "X$dir" = "X$file/" && dir=
  3736. -        dir="$dir$objdir"
  3737. -
  3738. -        # See the names of the shared library.
  3739. -        set dummy $library_names
  3740. -        if test -n "$2"; then
  3741. -          realname="$2"
  3742. -          shift
  3743. -          shift
  3744. -
  3745. -          # Install the shared library and build the symlinks.
  3746. -          $show "$install_prog $dir/$realname $destdir/$realname"
  3747. -          $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3748. -          test "X$dlname" = "X$realname" && dlname=
  3749. -
  3750. -          # Support stripping libraries.
  3751. -          if test -n "$stripme"; then
  3752. -            if test -n "$striplib"; then
  3753. -              $show "$striplib $destdir/$realname"
  3754. -              $run $striplib $destdir/$realname || exit $?
  3755. -            else
  3756. -              $echo "$modename: warning: no library stripping program" 1>&2
  3757. -            fi
  3758. -          fi
  3759. -
  3760. -          if test $# -gt 0; then
  3761. -            # Delete the old symlinks.
  3762. -            rmcmd="$rm"
  3763. -            for linkname
  3764. -            do
  3765. -              rmcmd="$rmcmd $destdir/$linkname"
  3766. -            done
  3767. -            $show "$rmcmd"
  3768. -            $run $rmcmd
  3769. -
  3770. -            # ... and create new ones.
  3771. -            for linkname
  3772. -            do
  3773. -              test "X$dlname" = "X$linkname" && dlname=
  3774. -              $show "(cd $destdir && $LN_S $realname $linkname)"
  3775. -              $run eval "(cd $destdir && $LN_S $realname $linkname)"
  3776. -            done
  3777. -          fi
  3778. -
  3779. -          if test -n "$dlname"; then
  3780. -            # Install the dynamically-loadable library.
  3781. -            $show "$install_prog $dir/$dlname $destdir/$dlname"
  3782. -            $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3783. -          fi
  3784. -
  3785. -          # Do each command in the postinstall commands.
  3786. -          lib="$destdir/$realname"
  3787. -          cmds=`eval \\$echo \"$postinstall_cmds\"`
  3788. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  3789. -          for cmd in $cmds; do
  3790. -            IFS="$save_ifs"
  3791. -            $show "$cmd"
  3792. -            $run eval "$cmd" || exit $?
  3793. -          done
  3794. -          IFS="$save_ifs"
  3795. -        fi
  3796. -
  3797. -        # Install the pseudo-library for information purposes.
  3798. -        name=`$echo "$file" | sed 's%^.*/%%'`
  3799. -        $show "$install_prog $file $destdir/$name"
  3800. -        $run eval "$install_prog $file $destdir/$name" || exit $?
  3801. -
  3802. -        # Maybe install the static library, too.
  3803. -        test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3804. -        ;;
  3805. +    # Check to see that this really is a libtool archive.
  3806. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  3807. +    else
  3808. +      $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
  3809. +      $echo "$help" 1>&2
  3810. +      exit 1
  3811. +    fi
  3812. +
  3813. +    library_names=
  3814. +    old_library=
  3815. +    # If there is no directory component, then add one.
  3816. +    case "$file" in
  3817. +    */* | *\\*) . $file ;;
  3818. +    *) . ./$file ;;
  3819. +    esac
  3820. +
  3821. +    # Add the libdir to current_libdirs if it is the destination.
  3822. +    if test "X$destdir" = "X$libdir"; then
  3823. +      case "$current_libdirs " in
  3824. +      *" $libdir "*) ;;
  3825. +      *) current_libdirs="$current_libdirs $libdir" ;;
  3826. +      esac
  3827. +    else
  3828. +      # Note the libdir as a future libdir.
  3829. +      case "$future_libdirs " in
  3830. +      *" $libdir "*) ;;
  3831. +      *) future_libdirs="$future_libdirs $libdir" ;;
  3832. +      esac
  3833. +    fi
  3834. +
  3835. +    dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/"
  3836. +    test "X$dir" = "X$file/" && dir=
  3837. +    dir="$dir$objdir"
  3838. +
  3839. +    # See the names of the shared library.
  3840. +    set dummy $library_names
  3841. +    if test -n "$2"; then
  3842. +      realname="$2"
  3843. +      shift
  3844. +      shift
  3845. +
  3846. +      # Install the shared library and build the symlinks.
  3847. +      $show "$install_prog $dir/$realname $destdir/$realname"
  3848. +      $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $?
  3849. +      test "X$dlname" = "X$realname" && dlname=
  3850. +
  3851. +      if test $# -gt 0; then
  3852. +        # Delete the old symlinks, and create new ones.
  3853. +        for linkname
  3854. +        do
  3855. +          test "X$dlname" = "X$linkname" && dlname=
  3856. +          if test "$linkname" != "$realname"; then
  3857. +        $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3858. +        $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
  3859. +          fi
  3860. +        done
  3861. +      fi
  3862. +
  3863. +      if test -n "$dlname"; then
  3864. +        # Install the dynamically-loadable library.
  3865. +        $show "$install_prog $dir/$dlname $destdir/$dlname"
  3866. +        $run eval "$install_prog $dir/$dlname $destdir/$dlname" || exit $?
  3867. +      fi
  3868. +
  3869. +      # Do each command in the postinstall commands.
  3870. +      lib="$destdir/$realname"
  3871. +      eval cmds=\"$postinstall_cmds\"
  3872. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  3873. +      for cmd in $cmds; do
  3874. +        IFS="$save_ifs"
  3875. +        $show "$cmd"
  3876. +        $run eval "$cmd" || exit $?
  3877. +      done
  3878. +      IFS="$save_ifs"
  3879. +    fi
  3880. +
  3881. +    # Install the pseudo-library for information purposes.
  3882. +    name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3883. +    instname="$dir/$name"i
  3884. +    if test ! -f "$instname"; then
  3885. +      # Just in case it was removed...
  3886. +      $show "Creating $instname"
  3887. +      $rm "$instname"
  3888. +      sed 's/^installed=no$/installed=yes/' "$file" > "$instname"
  3889. +    fi
  3890. +    $show "$install_prog $instname $destdir/$name"
  3891. +    $run eval "$install_prog $instname $destdir/$name" || exit $?
  3892. +
  3893. +    # Maybe install the static library, too.
  3894. +    test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
  3895. +    ;;
  3896.  
  3897.        *.lo)
  3898. -        # Install (i.e. copy) a libtool object.
  3899. +    # Install (i.e. copy) a libtool object.
  3900. +
  3901. +    # Figure out destination file name, if it wasn't already specified.
  3902. +    if test -n "$destname"; then
  3903. +      destfile="$destdir/$destname"
  3904. +    else
  3905. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  3906. +      destfile="$destdir/$destfile"
  3907. +    fi
  3908. +
  3909. +    # Deduce the name of the destination old-style object file.
  3910. +    case "$destfile" in
  3911. +    *.lo)
  3912. +      staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
  3913. +      ;;
  3914. +    *.o | *.obj)
  3915. +      staticdest="$destfile"
  3916. +      destfile=
  3917. +      ;;
  3918. +    *)
  3919. +      $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3920. +      $echo "$help" 1>&2
  3921. +      exit 1
  3922. +      ;;
  3923. +    esac
  3924. +
  3925. +    # Install the libtool object if requested.
  3926. +    if test -n "$destfile"; then
  3927. +      $show "$install_prog $file $destfile"
  3928. +      $run eval "$install_prog $file $destfile" || exit $?
  3929. +    fi
  3930. +
  3931. +    # Install the old object if enabled.
  3932. +    if test "$build_old_libs" = yes; then
  3933. +      # Deduce the name of the old-style object file.
  3934. +      staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
  3935.  
  3936. -        # Figure out destination file name, if it wasn't already specified.
  3937. -        if test -n "$destname"; then
  3938. -          destfile="$destdir/$destname"
  3939. -        else
  3940. -          destfile=`$echo "$file" | sed 's%^.*/%%'`
  3941. -          destfile="$destdir/$destfile"
  3942. -        fi
  3943. -
  3944. -        # Deduce the name of the destination old-style object file.
  3945. -        case "$destfile" in
  3946. -        *.lo)
  3947. -          staticdest=`$echo "$destfile" | sed 's/\.lo$/\.o/'`
  3948. -          ;;
  3949. -        *.o)
  3950. -          staticdest="$destfile"
  3951. -          destfile=
  3952. -          ;;
  3953. -        *)
  3954. -          $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
  3955. -          $echo "$help" 1>&2
  3956. -          exit 1
  3957. -          ;;
  3958. -        esac
  3959. -
  3960. -        # Install the libtool object if requested.
  3961. -        if test -n "$destfile"; then
  3962. -          $show "$install_prog $file $destfile"
  3963. -          $run eval "$install_prog $file $destfile" || exit $?
  3964. -        fi
  3965. -
  3966. -        # Install the old object if enabled.
  3967. -        if test "$build_old_libs" = yes; then
  3968. -          # Deduce the name of the old-style object file.
  3969. -          staticobj=`$echo "$file" | sed 's/\.lo$/\.o/'`
  3970. -
  3971. -          $show "$install_prog $staticobj $staticdest"
  3972. -          $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3973. -        fi
  3974. -        exit 0
  3975. -        ;;
  3976. +      $show "$install_prog $staticobj $staticdest"
  3977. +      $run eval "$install_prog \$staticobj \$staticdest" || exit $?
  3978. +    fi
  3979. +    exit 0
  3980. +    ;;
  3981.  
  3982.        *)
  3983. -        # Do a test to see if this is really a libtool program.
  3984. -        if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
  3985. -          link_against_libtool_libs=
  3986. -          finalize_command=
  3987. -
  3988. -          # If there is no directory component, then add one.
  3989. -          case "$file" in
  3990. -          */*) . $file ;;
  3991. -          *) . ./$file ;;
  3992. -          esac
  3993. -
  3994. -          # Check the variables that should have been set.
  3995. -          if test -z "$link_against_libtool_libs" || test -z "$finalize_command"; then
  3996. -            $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  3997. -            exit 1
  3998. -          fi
  3999. -
  4000. -          finalize=yes
  4001. -          for lib in $link_against_libtool_libs; do
  4002. -            # Check to see that each library is installed.
  4003. -            libdir=
  4004. -            if test -f "$lib"; then
  4005. -              # If there is no directory component, then add one.
  4006. -              case "$lib" in
  4007. -              */*) . $lib ;;
  4008. -              *) . ./$lib ;;
  4009. -              esac
  4010. -            fi
  4011. -            libfile="$libdir/`$echo "$lib" | sed 's%^.*/%%g'`"
  4012. -            if test -z "$libdir"; then
  4013. -              $echo "$modename: warning: \`$lib' contains no -rpath information" 1>&2
  4014. -            elif test -f "$libfile"; then :
  4015. -            else
  4016. -              $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4017. -              finalize=no
  4018. -            fi
  4019. -          done
  4020. -
  4021. -          if test "$hardcode_action" = relink; then
  4022. -            if test "$finalize" = yes; then
  4023. -              $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
  4024. -              $show "$finalize_command"
  4025. -              if $run eval "$finalize_command"; then :
  4026. -              else
  4027. -                $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4028. -                continue
  4029. -              fi
  4030. -              file="$objdir/$file"T
  4031. -            else
  4032. -              $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
  4033. -            fi
  4034. -          else
  4035. -            # Install the binary that we compiled earlier.
  4036. -        file=`$echo "$file" | sed "s%\([^/]*\)$%$objdir/\1%"`
  4037. -          fi
  4038. -        fi
  4039. -
  4040. -        $show "$install_prog$stripme $file $dest"
  4041. -        $run eval "$install_prog\$stripme \$file \$dest" || exit $?
  4042. -        ;;
  4043. +    # Figure out destination file name, if it wasn't already specified.
  4044. +    if test -n "$destname"; then
  4045. +      destfile="$destdir/$destname"
  4046. +    else
  4047. +      destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4048. +      destfile="$destdir/$destfile"
  4049. +    fi
  4050. +
  4051. +    # Do a test to see if this is really a libtool program.
  4052. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4053. +      link_against_libtool_libs=
  4054. +      relink_command=
  4055. +
  4056. +      # If there is no directory component, then add one.
  4057. +      case "$file" in
  4058. +      */* | *\\*) . $file ;;
  4059. +      *) . ./$file ;;
  4060. +      esac
  4061. +
  4062. +      # Check the variables that should have been set.
  4063. +      if test -z "$link_against_libtool_libs"; then
  4064. +        $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
  4065. +        exit 1
  4066. +      fi
  4067. +
  4068. +      finalize=yes
  4069. +      for lib in $link_against_libtool_libs; do
  4070. +        # Check to see that each library is installed.
  4071. +        libdir=
  4072. +        if test -f "$lib"; then
  4073. +          # If there is no directory component, then add one.
  4074. +          case "$lib" in
  4075. +          */* | *\\*) . $lib ;;
  4076. +          *) . ./$lib ;;
  4077. +          esac
  4078. +        fi
  4079. +        libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`"
  4080. +        if test -n "$libdir" && test ! -f "$libfile"; then
  4081. +          $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
  4082. +          finalize=no
  4083. +        fi
  4084. +      done
  4085. +
  4086. +      outputname=
  4087. +      if test "$fast_install" = no && test -n "$relink_command"; then
  4088. +        if test "$finalize" = yes; then
  4089. +          outputname="/tmp/$$-$file"
  4090. +          # Replace the output file specification.
  4091. +          relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
  4092. +
  4093. +          $echo "$modename: warning: relinking \`$file' on behalf of your buggy system linker" 1>&2
  4094. +          $show "$relink_command"
  4095. +          if $run eval "$relink_command"; then :
  4096. +          else
  4097. +        $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
  4098. +        continue
  4099. +          fi
  4100. +          file="$outputname"
  4101. +        else
  4102. +          $echo "$modename: warning: cannot relink \`$file' on behalf of your buggy system linker" 1>&2
  4103. +        fi
  4104. +      else
  4105. +        # Install the binary that we compiled earlier.
  4106. +        file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
  4107. +      fi
  4108. +    fi
  4109. +
  4110. +    $show "$install_prog$stripme $file $destfile"
  4111. +    $run eval "$install_prog\$stripme \$file \$destfile" || exit $?
  4112. +    test -n "$outputname" && $rm $outputname
  4113. +    ;;
  4114.        esac
  4115.      done
  4116.  
  4117.      for file in $staticlibs; do
  4118. -      name=`$echo "$file" | sed 's%^.*/%%'`
  4119. +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4120.  
  4121.        # Set up the ranlib parameters.
  4122.        oldlib="$destdir/$name"
  4123. @@ -1918,23 +3264,13 @@
  4124.        $show "$install_prog $file $oldlib"
  4125.        $run eval "$install_prog \$file \$oldlib" || exit $?
  4126.  
  4127. -      # Support stripping libraries.
  4128. -      if test -n "$stripme"; then
  4129. -        if test -n "$old_striplib"; then
  4130. -          $show "$old_striplib $oldlib"
  4131. -          $run $old_striplib $oldlib || exit $?
  4132. -        else
  4133. -          $echo "$modename: warning: no static library stripping program" 1>&2
  4134. -        fi
  4135. -      fi
  4136. -
  4137.        # Do each command in the postinstall commands.
  4138. -      cmds=`eval \\$echo \"$old_postinstall_cmds\"`
  4139. -      IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  4140. +      eval cmds=\"$old_postinstall_cmds\"
  4141. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4142.        for cmd in $cmds; do
  4143. -        IFS="$save_ifs"
  4144. -        $show "$cmd"
  4145. -        $run eval "$cmd" || exit $?
  4146. +    IFS="$save_ifs"
  4147. +    $show "$cmd"
  4148. +    $run eval "$cmd" || exit $?
  4149.        done
  4150.        IFS="$save_ifs"
  4151.      done
  4152. @@ -1957,38 +3293,73 @@
  4153.    finish)
  4154.      modename="$modename: finish"
  4155.      libdirs="$nonopt"
  4156. +    admincmds=
  4157.  
  4158.      if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
  4159.        for dir
  4160.        do
  4161. -        libdirs="$libdirs $dir"
  4162. +    libdirs="$libdirs $dir"
  4163.        done
  4164.  
  4165.        for libdir in $libdirs; do
  4166.      if test -n "$finish_cmds"; then
  4167.        # Do each command in the finish commands.
  4168. -      cmds=`eval \\$echo \"$finish_cmds\"`
  4169. -          IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  4170. -          for cmd in $cmds; do
  4171. -            IFS="$save_ifs"
  4172. -            $show "$cmd"
  4173. -            $run eval "$cmd"
  4174. -          done
  4175. -          IFS="$save_ifs"
  4176. +      eval cmds=\"$finish_cmds\"
  4177. +      IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4178. +      for cmd in $cmds; do
  4179. +        IFS="$save_ifs"
  4180. +        $show "$cmd"
  4181. +        $run eval "$cmd" || admincmds="$admincmds
  4182. +       $cmd"
  4183. +      done
  4184. +      IFS="$save_ifs"
  4185.      fi
  4186.      if test -n "$finish_eval"; then
  4187.        # Do the single finish_eval.
  4188. -      cmds=`eval \\$echo \"$finish_eval\"`
  4189. -      $run eval "$cmds"
  4190. +      eval cmds=\"$finish_eval\"
  4191. +      $run eval "$cmds" || admincmds="$admincmds
  4192. +       $cmds"
  4193.      fi
  4194.        done
  4195.      fi
  4196.  
  4197. -    echo "To link against installed libraries in LIBDIR, users may have to:"
  4198. +    # Exit here if they wanted silent mode.
  4199. +    test "$show" = : && exit 0
  4200. +
  4201. +    echo "----------------------------------------------------------------------"
  4202. +    echo "Libraries have been installed in:"
  4203. +    for libdir in $libdirs; do
  4204. +      echo "   $libdir"
  4205. +    done
  4206. +    echo
  4207. +    echo "If you ever happen to want to link against installed libraries"
  4208. +    echo "in a given directory, LIBDIR, you must either use libtool, and"
  4209. +    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
  4210. +    echo "flag during linking and do at least one of the following:"
  4211.      if test -n "$shlibpath_var"; then
  4212. -      echo "   - add LIBDIR to their \`$shlibpath_var' environment variable"
  4213. +      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
  4214. +      echo "     during execution"
  4215. +    fi
  4216. +    if test -n "$runpath_var"; then
  4217. +      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
  4218. +      echo "     during linking"
  4219. +    fi
  4220. +    if test -n "$hardcode_libdir_flag_spec"; then
  4221. +      libdir=LIBDIR
  4222. +      eval flag=\"$hardcode_libdir_flag_spec\"
  4223. +
  4224. +      echo "   - use the \`$flag' linker flag"
  4225.      fi
  4226. -    echo "   - use the \`-LLIBDIR' linker flag"
  4227. +    if test -n "$admincmds"; then
  4228. +      echo "   - have your system administrator run these commands:$admincmds"
  4229. +    fi
  4230. +    if test -f /etc/ld.so.conf; then
  4231. +      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
  4232. +    fi
  4233. +    echo
  4234. +    echo "See any operating system documentation about shared libraries for"
  4235. +    echo "more information, such as the ld(1) and ld.so(8) manual pages."
  4236. +    echo "----------------------------------------------------------------------"
  4237.      exit 0
  4238.      ;;
  4239.  
  4240. @@ -2006,8 +3377,7 @@
  4241.  
  4242.      # Handle -dlopen flags immediately.
  4243.      for file in $execute_dlfiles; do
  4244. -      if test -f "$file"; then :
  4245. -      else
  4246. +      if test ! -f "$file"; then
  4247.      $echo "$modename: \`$file' is not a file" 1>&2
  4248.      $echo "$help" 1>&2
  4249.      exit 1
  4250. @@ -2016,22 +3386,22 @@
  4251.        dir=
  4252.        case "$file" in
  4253.        *.la)
  4254. -        # Check to see that this really is a libtool archive.
  4255. -        if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then :
  4256. -        else
  4257. -          $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4258. -          $echo "$help" 1>&2
  4259. -          exit 1
  4260. -        fi
  4261. +    # Check to see that this really is a libtool archive.
  4262. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
  4263. +    else
  4264. +      $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
  4265. +      $echo "$help" 1>&2
  4266. +      exit 1
  4267. +    fi
  4268.  
  4269.      # Read the libtool library.
  4270.      dlname=
  4271.      library_names=
  4272.  
  4273. -        # If there is no directory component, then add one.
  4274. +    # If there is no directory component, then add one.
  4275.      case "$file" in
  4276. -    */*) . $file ;;
  4277. -        *) . ./$file ;;
  4278. +    */* | *\\*) . $file ;;
  4279. +    *) . ./$file ;;
  4280.      esac
  4281.  
  4282.      # Skip this library if it cannot be dlopened.
  4283. @@ -2041,7 +3411,7 @@
  4284.        continue
  4285.      fi
  4286.  
  4287. -    dir=`$echo "$file" | sed 's%/[^/]*$%%'`
  4288. +    dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4289.      test "X$dir" = "X$file" && dir=.
  4290.  
  4291.      if test -f "$dir/$objdir/$dlname"; then
  4292. @@ -2054,13 +3424,13 @@
  4293.  
  4294.        *.lo)
  4295.      # Just add the directory containing the .lo file.
  4296. -    dir=`$echo "$file" | sed 's%/[^/]*$%%'`
  4297. +    dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4298.      test "X$dir" = "X$file" && dir=.
  4299.      ;;
  4300.  
  4301.        *)
  4302.      $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
  4303. -        continue
  4304. +    continue
  4305.      ;;
  4306.        esac
  4307.  
  4308. @@ -2087,20 +3457,21 @@
  4309.        case "$file" in
  4310.        -*) ;;
  4311.        *)
  4312. -    if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
  4313. +    # Do a test to see if this is really a libtool program.
  4314. +    if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4315.        # If there is no directory component, then add one.
  4316.        case "$file" in
  4317. -      */*) . $file ;;
  4318. +      */* | *\\*) . $file ;;
  4319.        *) . ./$file ;;
  4320.        esac
  4321.  
  4322.        # Transform arg to wrapped name.
  4323.        file="$progdir/$program"
  4324.      fi
  4325. -        ;;
  4326. +    ;;
  4327.        esac
  4328.        # Quote arguments (to preserve shell metacharacters).
  4329. -      file=`$echo "$file" | sed "$sed_quote_subst"`
  4330. +      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
  4331.        args="$args \"$file\""
  4332.      done
  4333.  
  4334. @@ -2108,6 +3479,14 @@
  4335.        # Export the shlibpath_var.
  4336.        eval "export $shlibpath_var"
  4337.  
  4338. +      # Restore saved enviroment variables
  4339. +      if test "${save_LC_ALL+set}" = set; then
  4340. +    LC_ALL="$save_LC_ALL"; export LC_ALL
  4341. +      fi
  4342. +      if test "${save_LANG+set}" = set; then
  4343. +    LANG="$save_LANG"; export LANG
  4344. +      fi
  4345. +
  4346.        # Now actually exec the command.
  4347.        eval "exec \$cmd$args"
  4348.  
  4349. @@ -2143,33 +3522,33 @@
  4350.      fi
  4351.  
  4352.      for file in $files; do
  4353. -      dir=`$echo "$file" | sed -e 's%/[^/]*$%%'`
  4354. +      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
  4355.        test "X$dir" = "X$file" && dir=.
  4356. -      name=`$echo "$file" | sed -e 's%^.*/%%'`
  4357. +      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
  4358.  
  4359.        rmfiles="$file"
  4360.  
  4361.        case "$name" in
  4362.        *.la)
  4363. -        # Possibly a libtool archive, so verify it.
  4364. -        if egrep '^# Generated by ltmain.sh' $file >/dev/null 2>&1; then
  4365. -          . $dir/$name
  4366. -
  4367. -          # Delete the libtool libraries and symlinks.
  4368. -          for n in $library_names; do
  4369. -            rmfiles="$rmfiles $dir/$n"
  4370. -            test "X$n" = "X$dlname" && dlname=
  4371. -          done
  4372. -          test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  4373. -          test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  4374. +    # Possibly a libtool archive, so verify it.
  4375. +    if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
  4376. +      . $dir/$name
  4377. +
  4378. +      # Delete the libtool libraries and symlinks.
  4379. +      for n in $library_names; do
  4380. +        rmfiles="$rmfiles $dir/$n"
  4381. +        test "X$n" = "X$dlname" && dlname=
  4382. +      done
  4383. +      test -n "$dlname" && rmfiles="$rmfiles $dir/$dlname"
  4384. +      test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library"
  4385.  
  4386.        $show "$rm $rmfiles"
  4387.        $run $rm $rmfiles
  4388.  
  4389.        if test -n "$library_names"; then
  4390.          # Do each command in the postuninstall commands.
  4391. -        cmds=`eval \\$echo \"$postuninstall_cmds\"`
  4392. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  4393. +        eval cmds=\"$postuninstall_cmds\"
  4394. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4395.          for cmd in $cmds; do
  4396.            IFS="$save_ifs"
  4397.            $show "$cmd"
  4398. @@ -2178,10 +3557,10 @@
  4399.          IFS="$save_ifs"
  4400.        fi
  4401.  
  4402. -          if test -n "$old_library"; then
  4403. +      if test -n "$old_library"; then
  4404.          # Do each command in the old_postuninstall commands.
  4405. -        cmds=`eval \\$echo \"$old_postuninstall_cmds\"`
  4406. -        IFS="${IFS=     }"; save_ifs="$IFS"; IFS=';'
  4407. +        eval cmds=\"$old_postuninstall_cmds\"
  4408. +        IFS="${IFS=     }"; save_ifs="$IFS"; IFS='~'
  4409.          for cmd in $cmds; do
  4410.            IFS="$save_ifs"
  4411.            $show "$cmd"
  4412. @@ -2190,21 +3569,21 @@
  4413.          IFS="$save_ifs"
  4414.        fi
  4415.  
  4416. -          # FIXME: should reinstall the best remaining shared library.
  4417. -        fi
  4418. -        ;;
  4419. +      # FIXME: should reinstall the best remaining shared library.
  4420. +    fi
  4421. +    ;;
  4422.  
  4423.        *.lo)
  4424. -        if test "$build_old_libs" = yes; then
  4425. -          oldobj=`$echo "$name" | sed 's/\.lo$/\.o/'`
  4426. -          rmfiles="$rmfiles $dir/$oldobj"
  4427. -        fi
  4428. +    if test "$build_old_libs" = yes; then
  4429. +      oldobj=`$echo "X$name" | $Xsed -e "$lo2o"`
  4430. +      rmfiles="$rmfiles $dir/$oldobj"
  4431. +    fi
  4432.      $show "$rm $rmfiles"
  4433.      $run $rm $rmfiles
  4434. -        ;;
  4435. +    ;;
  4436.  
  4437.        *)
  4438. -          $show "$rm $rmfiles"
  4439. +    $show "$rm $rmfiles"
  4440.      $run $rm $rmfiles
  4441.      ;;
  4442.        esac
  4443. @@ -2226,13 +3605,15 @@
  4444.  
  4445.  # We need to display help for each of the modes.
  4446.  case "$mode" in
  4447. -"") cat <<EOF
  4448. -Usage: $modename [OPTION]... [MODE-ARG]...
  4449. +"") $echo \
  4450. +"Usage: $modename [OPTION]... [MODE-ARG]...
  4451.  
  4452.  Provide generalized library-building support services.
  4453.  
  4454. +    --config          show all configuration variables
  4455. +    --debug           enable verbose shell tracing
  4456.  -n, --dry-run         display commands without modifying any files
  4457. -    --features        display configuration information and exit
  4458. +    --features        display basic configuration information and exit
  4459.      --finish          same as \`--mode=finish'
  4460.      --help            display this help message and exit
  4461.      --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
  4462. @@ -2250,28 +3631,32 @@
  4463.        uninstall       remove libraries from an installed directory
  4464.  
  4465.  MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
  4466. -a more detailed description of MODE.
  4467. -EOF
  4468. +a more detailed description of MODE."
  4469. +  exit 0
  4470.    ;;
  4471.  
  4472.  compile)
  4473. -  cat <<EOF
  4474. -Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  4475. +  $echo \
  4476. +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
  4477.  
  4478.  Compile a source file into a libtool library object.
  4479.  
  4480. +This mode accepts the following additional options:
  4481. +
  4482. +  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
  4483. +  -static           always build a \`.o' file suitable for static linking
  4484. +
  4485.  COMPILE-COMMAND is a command to be used in creating a \`standard' object file
  4486.  from the given SOURCEFILE.
  4487.  
  4488.  The output file name is determined by removing the directory component from
  4489.  SOURCEFILE, then substituting the C source code suffix \`.c' with the
  4490. -library object suffix, \`.lo'.
  4491. -EOF
  4492. +library object suffix, \`.lo'."
  4493.    ;;
  4494.  
  4495.  execute)
  4496. -  cat <<EOF
  4497. -Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  4498. +  $echo \
  4499. +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
  4500.  
  4501.  Automatically set library path, then run a program.
  4502.  
  4503. @@ -2286,26 +3671,24 @@
  4504.  into their corresponding uninstalled binary, and any of their required library
  4505.  directories are added to the library path.
  4506.  
  4507. -Then, COMMAND is executed, with ARGS as arguments.
  4508. -EOF
  4509. +Then, COMMAND is executed, with ARGS as arguments."
  4510.    ;;
  4511.  
  4512.  finish)
  4513. -  cat <<EOF
  4514. -Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  4515. +  $echo \
  4516. +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
  4517.  
  4518.  Complete the installation of libtool libraries.
  4519.  
  4520.  Each LIBDIR is a directory that contains libtool libraries.
  4521.  
  4522.  The commands that this mode executes may require superuser privileges.  Use
  4523. -the \`--dry-run' option if you just want to see what would be executed.
  4524. -EOF
  4525. +the \`--dry-run' option if you just want to see what would be executed."
  4526.    ;;
  4527.  
  4528.  install)
  4529. -  cat <<EOF
  4530. -Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  4531. +  $echo \
  4532. +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
  4533.  
  4534.  Install executables or libraries.
  4535.  
  4536. @@ -2313,13 +3696,12 @@
  4537.  either the \`install' or \`cp' program.
  4538.  
  4539.  The rest of the components are interpreted as arguments to that command (only
  4540. -BSD-compatible install options are recognized).
  4541. -EOF
  4542. +BSD-compatible install options are recognized)."
  4543.    ;;
  4544.  
  4545.  link)
  4546. -  cat <<EOF
  4547. -Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  4548. +  $echo \
  4549. +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
  4550.  
  4551.  Link object files or libraries together to form another library, or to
  4552.  create an executable program.
  4553. @@ -2330,17 +3712,23 @@
  4554.  The following components of LINK-COMMAND are treated specially:
  4555.  
  4556.    -all-static       do not do any dynamic linking at all
  4557. +  -avoid-version    do not add a version suffix if possible
  4558.    -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
  4559. -  -dlpreopen FILE   link in FILE and add its symbols to dld_preloaded_symbols
  4560. +  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
  4561.    -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
  4562. +  -export-symbols SYMFILE
  4563. +            try to export only the symbols listed in SYMFILE
  4564.    -LLIBDIR          search LIBDIR for required installed libraries
  4565.    -lNAME            OUTPUT-FILE requires the installed library libNAME
  4566. +  -module           build a library that can dlopened
  4567.    -no-undefined     declare that a library does not refer to external symbols
  4568.    -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
  4569. +  -release RELEASE  specify package release information
  4570.    -rpath LIBDIR     the created library will eventually be installed in LIBDIR
  4571. +  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
  4572.    -static           do not do any dynamic linking of libtool libraries
  4573.    -version-info CURRENT[:REVISION[:AGE]]
  4574. -                    specify library version info [each variable defaults to 0]
  4575. +            specify library version info [each variable defaults to 0]
  4576.  
  4577.  All other options (arguments beginning with \`-') are ignored.
  4578.  
  4579. @@ -2348,20 +3736,20 @@
  4580.  treated as uninstalled libtool libraries, other files are standard or library
  4581.  object files.
  4582.  
  4583. -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only
  4584. -library objects (\`.lo' files) may be specified, and \`-rpath' is required.
  4585. +If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
  4586. +only library objects (\`.lo' files) may be specified, and \`-rpath' is
  4587. +required, except when creating a convenience library.
  4588.  
  4589. -If OUTPUT-FILE ends in \`.a', then a standard library is created using \`ar'
  4590. -and \`ranlib'.
  4591. +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
  4592. +using \`ar' and \`ranlib', or on Windows using \`lib'.
  4593.  
  4594. -If OUTPUT-FILE ends in \`.lo' or \`.o', then a reloadable object file is
  4595. -created, otherwise an executable program is created.
  4596. -EOF
  4597. +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
  4598. +is created, otherwise an executable program is created."
  4599.    ;;
  4600.  
  4601.  uninstall)
  4602. -  cat <<EOF
  4603. -Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4604. +  $echo
  4605. +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
  4606.  
  4607.  Remove libraries from an installation directory.
  4608.  
  4609. @@ -2370,8 +3758,7 @@
  4610.  to RM.
  4611.  
  4612.  If FILE is a libtool library, all the files associated with it are deleted.
  4613. -Otherwise, only FILE itself is deleted using RM.
  4614. -EOF
  4615. +Otherwise, only FILE itself is deleted using RM."
  4616.    ;;
  4617.  
  4618.  *)
  4619. --- ./ltconfig    Mon Dec 14 14:52:56 1998
  4620. +++ ../fnlib-0.4/./ltconfig    Thu Apr 15 16:05:59 1999
  4621. @@ -1,8 +1,7 @@
  4622.  #! /bin/sh
  4623.  
  4624.  # ltconfig - Create a system-specific libtool.
  4625. -# Generated automatically from ltconfig.in by configure.
  4626. -# Copyright (C) 1996, 1997, Free Software Foundation, Inc.
  4627. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  4628.  # Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  4629.  #
  4630.  # This file is free software; you can redistribute it and/or modify it
  4631. @@ -26,54 +25,160 @@
  4632.  
  4633.  # A lot of this script is taken from autoconf-2.10.
  4634.  
  4635. +# Check that we are running under the correct shell.
  4636. +SHELL=${CONFIG_SHELL-/bin/sh}
  4637.  echo=echo
  4638. -if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  4639. +if test "X$1" = X--no-reexec; then
  4640. +  # Discard the --no-reexec flag, and continue.
  4641. +  shift
  4642. +elif test "X$1" = X--fallback-echo; then
  4643. +  # used as fallback echo
  4644. +  shift
  4645. +  cat <<EOF
  4646. +$*
  4647. +EOF
  4648. +  exit 0
  4649. +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
  4650. +  # Yippee, $echo works!
  4651. +  :
  4652.  else
  4653. -  # The Solaris and AIX default echo program unquotes backslashes.
  4654. -  # This makes it impossible to quote backslashes using
  4655. +  # Restart under the correct shell.
  4656. +  exec "$SHELL" "$0" --no-reexec ${1+"$@"}
  4657. +fi
  4658. +
  4659. +# Find the correct PATH separator.  Usually this is `:', but
  4660. +# DJGPP uses `;' like DOS.
  4661. +if test "X${PATH_SEPARATOR+set}" != "Xset"; then
  4662. +  UNAME=${UNAME-`uname 2>/dev/null`}
  4663. +  case X$UNAME in
  4664. +    *-DOS) PATH_SEPARATOR=';' ;;
  4665. +    *)     PATH_SEPARATOR=':' ;;
  4666. +  esac
  4667. +fi
  4668. +
  4669. +# The HP-UX ksh and POSIX shell print the target directory to stdout
  4670. +# if CDPATH is set.
  4671. +if test "${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  4672. +
  4673. +if test "X${echo_test_string+set}" != "Xset"; then
  4674. +  # find a string as large as possible, as long as the shell can cope with it
  4675. +  for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
  4676. +    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
  4677. +    if (echo_test_string="`eval $cmd`") 2>/dev/null &&
  4678. +       echo_test_string="`eval $cmd`" &&
  4679. +       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then
  4680. +      break
  4681. +    fi
  4682. +  done
  4683. +fi
  4684. +
  4685. +if test "X`($echo '\t') 2>/dev/null`" != 'X\t' ||
  4686. +   test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then
  4687. +  # The Solaris, AIX, and Digital Unix default echo programs unquote
  4688. +  # backslashes.  This makes it impossible to quote backslashes using
  4689.    #   echo "$something" | sed 's/\\/\\\\/g'
  4690. -  # So, we emulate echo with printf '%s\n'
  4691. -  echo="printf %s\\n"
  4692. -  if test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then :
  4693. -  else
  4694. -    # Oops.  We have no working printf.  Try to find a not-so-buggy echo.
  4695. -    echo=echo
  4696. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  4697. -    for dir in $PATH /usr/ucb; do
  4698. -      if test -f $dir/echo && test "X`$dir/echo '\t'`" = 'X\t'; then
  4699. -        echo="$dir/echo"
  4700. -        break
  4701. +  #
  4702. +  # So, first we look for a working echo in the user's PATH.
  4703. +
  4704. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  4705. +  for dir in $PATH /usr/ucb; do
  4706. +    if test -f $dir/echo &&
  4707. +       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
  4708. +       test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4709. +      echo="$dir/echo"
  4710. +      break
  4711. +    fi
  4712. +  done
  4713. +  IFS="$save_ifs"
  4714. +
  4715. +  if test "X$echo" = Xecho; then
  4716. +    # We didn't find a better echo, so look for alternatives.
  4717. +    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
  4718. +       test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4719. +      # This shell has a builtin print -r that does the trick.
  4720. +      echo='print -r'
  4721. +    elif test -f /bin/ksh && test "X$CONFIG_SHELL" != X/bin/ksh; then
  4722. +      # If we have ksh, try running ltconfig again with it.
  4723. +      ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}"
  4724. +      export ORIGINAL_CONFIG_SHELL
  4725. +      CONFIG_SHELL=/bin/ksh
  4726. +      export CONFIG_SHELL
  4727. +      exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"}
  4728. +    else
  4729. +      # Try using printf.
  4730. +      echo='printf "%s\n"'
  4731. +      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
  4732. +     test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4733. +    # Cool, printf works
  4734. +    :
  4735. +      elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4736. +       test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4737. +    CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL"
  4738. +    export CONFIG_SHELL
  4739. +    SHELL="$CONFIG_SHELL"
  4740. +    export SHELL
  4741. +    echo="$CONFIG_SHELL $0 --fallback-echo"
  4742. +      elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' &&
  4743. +       test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then
  4744. +    echo="$CONFIG_SHELL $0 --fallback-echo"
  4745. +      else
  4746. +    # maybe with a smaller string...
  4747. +    prev=:
  4748. +
  4749. +    for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
  4750. +      if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then
  4751. +        break
  4752. +      fi
  4753. +      prev="$cmd"
  4754. +    done
  4755. +
  4756. +    if test "$prev" != 'sed 50q "$0"'; then
  4757. +      echo_test_string=`eval $prev`
  4758. +      export echo_test_string
  4759. +      exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"}
  4760. +    else
  4761. +      # Oops.  We lost completely, so just stick with echo.
  4762. +      echo=echo
  4763. +    fi
  4764.        fi
  4765. -    done
  4766. -    IFS="$save_ifs"
  4767. +    fi
  4768.    fi
  4769.  fi
  4770.  
  4771. +# Sed substitution that helps us do robust quoting.  It backslashifies
  4772. +# metacharacters that are still active within double-quoted strings.
  4773. +Xsed='sed -e s/^X//'
  4774. +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  4775. +
  4776. +# Same as above, but do not quote variable references.
  4777. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  4778. +
  4779. +# Sed substitution to delay expansion of an escaped shell variable in a
  4780. +# double_quote_subst'ed string.
  4781. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
  4782. +
  4783.  # The name of this program.
  4784. -progname=`$echo "$0" | sed 's%^.*/%%'`
  4785. +progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'`
  4786.  
  4787.  # Constants:
  4788.  PROGRAM=ltconfig
  4789.  PACKAGE=libtool
  4790. -VERSION=1.0h
  4791. +VERSION=1.2f
  4792. +TIMESTAMP=" (1.385 1999/03/15 17:24:54)"
  4793.  ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.c 1>&5'
  4794.  ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.c $LIBS 1>&5'
  4795.  rm="rm -f"
  4796.  
  4797.  help="Try \`$progname --help' for more information."
  4798.  
  4799. -# Sed substitution that helps us do robust quoting.  It backslashifies
  4800. -# metacharacters that are still active within double-quoted strings.
  4801. -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
  4802. -
  4803. -# Same as above, but don't quote variable references.
  4804. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
  4805. -
  4806.  # Global variables:
  4807. +default_ofile=libtool
  4808.  can_build_shared=yes
  4809.  enable_shared=yes
  4810.  # All known linkers require a `.a' archive for static linking.
  4811.  enable_static=yes
  4812. +enable_fast_install=yes
  4813. +enable_dlopen=unknown
  4814.  ltmain=
  4815.  silent=
  4816.  srcdir=
  4817. @@ -81,9 +186,15 @@
  4818.  ac_config_sub=
  4819.  host=
  4820.  nonopt=
  4821. +ofile="$default_ofile"
  4822.  verify_host=yes
  4823.  with_gcc=no
  4824.  with_gnu_ld=no
  4825. +need_locks=yes
  4826. +ac_ext=c
  4827. +objext=o
  4828. +libext=a
  4829. +cache_file=
  4830.  
  4831.  old_AR="$AR"
  4832.  old_CC="$CC"
  4833. @@ -93,6 +204,8 @@
  4834.  old_LN_S="$LN_S"
  4835.  old_NM="$NM"
  4836.  old_RANLIB="$RANLIB"
  4837. +old_DLLTOOL="$DLLTOOL"
  4838. +old_AS="$AS"
  4839.  
  4840.  # Parse the command line options.
  4841.  args=
  4842. @@ -113,33 +226,49 @@
  4843.  
  4844.    case "$option" in
  4845.    --help) cat <<EOM
  4846. -Usage: $progname [OPTION]... LTMAIN [HOST]
  4847. +Usage: $progname [OPTION]... [HOST [LTMAIN]]
  4848.  
  4849.  Generate a system-specific libtool script.
  4850.  
  4851. +    --debug                enable verbose shell tracing
  4852.      --disable-shared       do not build shared libraries
  4853.      --disable-static       do not build static libraries
  4854. +    --disable-fast-install do not optimize for fast installation
  4855. +    --enable-dlopen        enable dlopen support
  4856. +    --enable-dlopen-self   enable support for dlopening programs
  4857.      --help                 display this help and exit
  4858.      --no-verify            do not verify that HOST is a valid host type
  4859. +-o, --output=FILE          specify the output file [default=$default_ofile]
  4860.      --quiet                same as \`--silent'
  4861. -    --silent               don't print informational messages
  4862. +    --silent               do not print informational messages
  4863.      --srcdir=DIR           find \`config.guess' in DIR
  4864.      --version              output version information and exit
  4865.      --with-gcc             assume that the GNU C compiler will be used
  4866.      --with-gnu-ld          assume that the C compiler uses the GNU linker
  4867. +    --disable-lock         disable file locking
  4868. +    --cache-file=FILE      configure cache file
  4869.  
  4870. -LTMAIN is the \`ltmain.sh' shell script fragment that provides basic libtool
  4871. -functionality.
  4872. +LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program
  4873. +that provides basic libtool functionality.
  4874.  
  4875.  HOST is the canonical host system name [default=guessed].
  4876.  EOM
  4877.    exit 0
  4878.    ;;
  4879.  
  4880. +  --debug)
  4881. +    echo "$progname: enabling shell trace mode"
  4882. +    set -x
  4883. +    ;;
  4884. +
  4885.    --disable-shared) enable_shared=no ;;
  4886.  
  4887.    --disable-static) enable_static=no ;;
  4888.  
  4889. +  --disable-fast-install) enable_fast_install=no ;;
  4890. +
  4891. +  --enable-dlopen) enable_dlopen=yes ;;
  4892. +
  4893.    --quiet | --silent) silent=yes ;;
  4894.  
  4895.    --srcdir) prev=srcdir ;;
  4896. @@ -147,11 +276,18 @@
  4897.  
  4898.    --no-verify) verify_host=no ;;
  4899.  
  4900. -  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION"; exit 0 ;;
  4901. +  --output | -o) prev=ofile ;;
  4902. +  --output=*) ofile="$optarg" ;;
  4903. +
  4904. +  --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;;
  4905.  
  4906.    --with-gcc) with_gcc=yes ;;
  4907.    --with-gnu-ld) with_gnu_ld=yes ;;
  4908.  
  4909. +  --disable-lock) need_locks=no ;;
  4910. +
  4911. +  --cache-file=*) cache_file="$optarg" ;;
  4912. +
  4913.    -*)
  4914.      echo "$progname: unrecognized option \`$option'" 1>&2
  4915.      echo "$help" 1>&2
  4916. @@ -162,7 +298,7 @@
  4917.      if test -z "$ltmain"; then
  4918.        ltmain="$option"
  4919.      elif test -z "$host"; then
  4920. -# FIXME This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  4921. +# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1
  4922.  #      if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then
  4923.  #        echo "$progname: warning \`$option' is not a valid host type" 1>&2
  4924.  #      fi
  4925. @@ -181,9 +317,10 @@
  4926.    exit 1
  4927.  fi
  4928.  
  4929. -if test -f "$ltmain"; then :
  4930. -else
  4931. -  echo "$progname: warning: \`$ltmain' does not exist" 1>&2
  4932. +if test ! -f "$ltmain"; then
  4933. +  echo "$progname: \`$ltmain' does not exist" 1>&2
  4934. +  echo "$help" 1>&2
  4935. +  exit 1
  4936.  fi
  4937.  
  4938.  # Quote any args containing shell metacharacters.
  4939. @@ -221,6 +358,11 @@
  4940.  if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
  4941.  if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
  4942.  
  4943. +if test -n "$cache_file" && test -r "$cache_file"; then
  4944. +  echo "loading cache $cache_file within ltconfig"
  4945. +  . $cache_file
  4946. +fi
  4947. +
  4948.  if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
  4949.    # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
  4950.    if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
  4951. @@ -234,8 +376,8 @@
  4952.  fi
  4953.  
  4954.  if test -z "$srcdir"; then
  4955. -  # Assume the source directory is the same one as the path to ltmain.sh.
  4956. -  srcdir=`echo "$ltmain" | sed 's%/[^/]*$%%'`
  4957. +  # Assume the source directory is the same one as the path to LTMAIN.
  4958. +  srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'`
  4959.    test "$srcdir" = "$ltmain" && srcdir=.
  4960.  fi
  4961.  
  4962. @@ -258,7 +400,7 @@
  4963.    ac_config_sub=$ac_aux_dir/config.sub
  4964.  
  4965.    # Make sure we can run config.sub.
  4966. -  if $ac_config_sub sun4 >/dev/null 2>&1; then :
  4967. +  if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then :
  4968.    else
  4969.      echo "$progname: cannot run $ac_config_sub" 1>&2
  4970.      echo "$help" 1>&2
  4971. @@ -270,14 +412,14 @@
  4972.    host_alias=$host
  4973.    case "$host_alias" in
  4974.    "")
  4975. -    if host_alias=`$ac_config_guess`; then :
  4976. +    if host_alias=`$SHELL $ac_config_guess`; then :
  4977.      else
  4978.        echo "$progname: cannot guess host type; you must specify one" 1>&2
  4979.        echo "$help" 1>&2
  4980.        exit 1
  4981.      fi ;;
  4982.    esac
  4983. -  host=`$ac_config_sub $host_alias`
  4984. +  host=`$SHELL $ac_config_sub $host_alias`
  4985.    echo "$ac_t$host" 1>&6
  4986.  
  4987.    # Make sure the host verified.
  4988. @@ -291,10 +433,10 @@
  4989.    host_alias=$host
  4990.  fi
  4991.  
  4992. -# Transform *-*-linux* to *-*-linux-gnu*, to support old configure scripts.
  4993. -case "$host" in
  4994. -*-*-linux-gnu*) ;;
  4995. -*-*-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  4996. +# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
  4997. +case "$host_os" in
  4998. +linux-gnu*) ;;
  4999. +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
  5000.  esac
  5001.  
  5002.  host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
  5003. @@ -326,7 +468,7 @@
  5004.    result=no
  5005.  
  5006.    echo $ac_n "checking for ranlib... $ac_c" 1>&6
  5007. -  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  5008. +  IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5009.    for dir in $PATH; do
  5010.      test -z "$dir" && dir=.
  5011.      if test -f $dir/ranlib; then
  5012. @@ -341,16 +483,20 @@
  5013.  fi
  5014.  
  5015.  if test -n "$RANLIB"; then
  5016. -  old_archive_cmds="$old_archive_cmds;\$RANLIB \$oldlib"
  5017. -  old_postinstall_cmds="$old_postinstall_cmds;\$RANLIB \$oldlib"
  5018. +  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
  5019. +  old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
  5020.  fi
  5021.  
  5022. +# Set sane defaults for `DLLTOOL' and `AS', used on cygwin.
  5023. +test -z "$DLLTOOL" && DLLTOOL=dlltool
  5024. +test -z "$AS" && AS=as
  5025. +
  5026.  # Check to see if we are using GCC.
  5027.  if test "$with_gcc" != yes || test -z "$CC"; then
  5028.    # If CC is not set, then try to find GCC or a usable CC.
  5029.    if test -z "$CC"; then
  5030.      echo $ac_n "checking for gcc... $ac_c" 1>&6
  5031. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  5032. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5033.      for dir in $PATH; do
  5034.        IFS="$save_ifs"
  5035.        test -z "$dir" && dir=.
  5036. @@ -371,7 +517,7 @@
  5037.    # Not "gcc", so try "cc", rejecting "/usr/ucb/cc".
  5038.    if test -z "$CC"; then
  5039.      echo $ac_n "checking for cc... $ac_c" 1>&6
  5040. -    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}:"
  5041. +    IFS="${IFS=     }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5042.      cc_rejected=no
  5043.      for dir in $PATH; do
  5044.        test -z "$dir" && dir=.
  5045. @@ -415,7 +561,7 @@
  5046.    # Now see if the compiler is really GCC.
  5047.    with_gcc=no
  5048.    echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6
  5049. -  echo "$progname:418: checking whether we are using GNU C" >&5
  5050. +  echo "$progname:564: checking whether we are using GNU C" >&5
  5051.  
  5052.    $rm conftest.c
  5053.    cat > conftest.c <<EOF
  5054. @@ -423,7 +569,7 @@
  5055.    yes;
  5056.  #endif
  5057.  EOF
  5058. -  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:426: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  5059. +  if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:572: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
  5060.      with_gcc=yes
  5061.    fi
  5062.    $rm conftest.c
  5063. @@ -434,25 +580,53 @@
  5064.  set dummy $CC
  5065.  compiler="$2"
  5066.  
  5067. +echo $ac_n "checking for object suffix... $ac_c" 1>&6
  5068. +$rm conftest*
  5069. +echo 'int i = 1;' > conftest.c
  5070. +echo "$progname:586: checking for object suffix" >& 5
  5071. +if { (eval echo $progname:587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then
  5072. +  # Append any warnings to the config.log.
  5073. +  cat conftest.err 1>&5
  5074. +
  5075. +  for ac_file in conftest.*; do
  5076. +    case $ac_file in
  5077. +    *.c) ;;
  5078. +    *) objext=`echo $ac_file | sed -e s/conftest.//` ;;
  5079. +    esac
  5080. +  done
  5081. +else
  5082. +  cat conftest.err 1>&5
  5083. +  echo "$progname: failed program was:" >&5
  5084. +  cat conftest.c >&5
  5085. +fi
  5086. +$rm conftest*
  5087. +echo "$ac_t$objext" 1>&6
  5088. +
  5089.  echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6
  5090.  pic_flag=
  5091. -profile_flag_pattern=
  5092.  special_shlib_compile_flags=
  5093.  wl=
  5094.  link_static_flag=
  5095.  no_builtin_flag=
  5096.  
  5097.  if test "$with_gcc" = yes; then
  5098. -  profile_flag_pattern='-pg?'
  5099.    wl='-Wl,'
  5100.    link_static_flag='-static'
  5101. -  no_builtin_flag=' -fno-builtin'
  5102.  
  5103.    case "$host_os" in
  5104. -  aix3* | aix4* | irix5* | irix6* | osf3* | osf4*)
  5105. +  beos* | irix5* | irix6* | osf3* | osf4*)
  5106.      # PIC is the default for these OSes.
  5107.      ;;
  5108. -  os2*)
  5109. +  aix*)
  5110. +    # Below there is a dirty hack to force normal static linking with -ldl
  5111. +    # The problem is because libdl dynamically linked with both libc and
  5112. +    # libC (AIX C++ library), which obviously doesn't included in libraries
  5113. +    # list by gcc. This cause undefined symbols with -static flags.
  5114. +    # This hack allows C programs to be linked with "-static -ldl", but
  5115. +    # we not sure about C++ programs.
  5116. +    link_static_flag="$link_static_flag ${wl}-lC"
  5117. +    ;;
  5118. +  cygwin* | mingw* | os2*)
  5119.      # We can build DLLs from non-PIC.
  5120.      ;;
  5121.    amigaos*)
  5122. @@ -473,10 +647,10 @@
  5123.      link_static_flag='-bnso -bI:/lib/syscalls.exp'
  5124.      ;;
  5125.  
  5126. -  hpux9* | hpux10*)
  5127. +  hpux9* | hpux10* | hpux11*)
  5128.      # Is there a better link_static_flag that works with the bundled CC?
  5129.      wl='-Wl,'
  5130. -    link_static_flag='${wl}-a ${wl}archive'
  5131. +    link_static_flag="${wl}-a ${wl}archive"
  5132.      pic_flag='+Z'
  5133.      ;;
  5134.  
  5135. @@ -486,7 +660,7 @@
  5136.      # PIC (with -KPIC) is the default.
  5137.      ;;
  5138.  
  5139. -  os2*)
  5140. +  cygwin* | mingw* | os2*)
  5141.      # We can build DLLs from non-PIC.
  5142.      ;;
  5143.  
  5144. @@ -502,7 +676,7 @@
  5145.      special_shlib_compile_flags='-belf'
  5146.      ;;
  5147.  
  5148. -  solaris2*)
  5149. +  solaris*)
  5150.      pic_flag='-KPIC'
  5151.      link_static_flag='-Bstatic'
  5152.      wl='-Wl,'
  5153. @@ -514,6 +688,12 @@
  5154.      wl='-Qoption ld '
  5155.      ;;
  5156.  
  5157. +  sysv4.2uw2* | sysv4.3* | sysv5*)
  5158. +    pic_flag='-KPIC'
  5159. +    link_static_flag='-Bstatic'
  5160. +    wl='-Wl,'
  5161. +    ;;
  5162. +
  5163.    uts4*)
  5164.      pic_flag='-pic'
  5165.      link_static_flag='-Bstatic'
  5166. @@ -531,35 +711,159 @@
  5167.    # Check to make sure the pic_flag actually works.
  5168.    echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6
  5169.    $rm conftest*
  5170. -  echo > conftest.c
  5171. +  echo "int some_variable = 0;" > conftest.c
  5172.    save_CFLAGS="$CFLAGS"
  5173.    CFLAGS="$CFLAGS $pic_flag -DPIC"
  5174. -  echo "$progname:537: checking if $compiler PIC flag $pic_flag works" >&5
  5175. -  if { (eval echo $progname:538: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  5176. +  echo "$progname:717: checking if $compiler PIC flag $pic_flag works" >&5
  5177. +  if { (eval echo $progname:718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then
  5178. +    # Append any warnings to the config.log.
  5179. +    cat conftest.err 1>&5
  5180. +    
  5181. +    case "$host_os" in
  5182. +    hpux9* | hpux10* | hpux11*)
  5183. +      # On HP-UX, both CC and GCC only warn that PIC is supported... then they
  5184. +      # create non-PIC objects.  So, if there were any warnings, we assume that
  5185. +      # PIC is not supported.
  5186. +      if test -s conftest.err; then
  5187. +    echo "$ac_t"no 1>&6
  5188. +    can_build_shared=no
  5189. +    pic_flag=
  5190. +      else
  5191. +    echo "$ac_t"yes 1>&6
  5192. +    pic_flag=" $pic_flag"
  5193. +      fi
  5194. +      ;;
  5195. +    *)
  5196. +      echo "$ac_t"yes 1>&6
  5197. +      pic_flag=" $pic_flag"
  5198. +      ;;
  5199. +    esac
  5200. +  else
  5201.      # Append any errors to the config.log.
  5202.      cat conftest.err 1>&5
  5203. +    can_build_shared=no
  5204. +    pic_flag=
  5205. +    echo "$ac_t"no 1>&6
  5206. +  fi
  5207. +  CFLAGS="$save_CFLAGS"
  5208. +  $rm conftest*
  5209. +else
  5210. +  echo "$ac_t"none 1>&6
  5211. +fi
  5212.  
  5213. -    # On HP-UX, the stripped-down bundled CC doesn't accept +Z, but also
  5214. -    # reports no error.  So, we need to grep stderr for (Bundled).
  5215. -    if grep '(Bundled)' conftest.err >/dev/null; then
  5216. +# Check to see if options -o and -c are simultaneously supported by compiler
  5217. +echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6
  5218. +$rm conftest*
  5219. +echo "int some_variable = 0;" > conftest.c
  5220. +save_CFLAGS="$CFLAGS"
  5221. +CFLAGS="$CFLAGS -c -o conftest2.o"
  5222. +echo "$progname:760: checking if $compiler supports -c -o file.o" >&5
  5223. +if { (eval echo $progname:761: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest2.o; then
  5224. +
  5225. +  # The compiler can only warn and ignore the option if not recognized
  5226. +  # So say no if there are warnings
  5227. +    if test -s conftest.err; then
  5228.        echo "$ac_t"no 1>&6
  5229. -      can_build_shared=no
  5230. -      pic_flag=
  5231. +      compiler_c_o=no
  5232.      else
  5233.        echo "$ac_t"yes 1>&6
  5234. -      pic_flag=" $pic_flag"
  5235. +      compiler_c_o=yes
  5236.      fi
  5237. +else
  5238. +  # Append any errors to the config.log.
  5239. +  cat conftest.err 1>&5
  5240. +  compiler_c_o=no
  5241. +  echo "$ac_t"no 1>&6
  5242. +fi
  5243. +CFLAGS="$save_CFLAGS"
  5244. +$rm conftest*
  5245. +
  5246. +if test x"$compiler_c_o" = x"yes"; then
  5247. +  # Check to see if we can write to a .lo
  5248. +  echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6
  5249. +  $rm conftest*
  5250. +  echo "int some_variable = 0;" > conftest.c
  5251. +  save_CFLAGS="$CFLAGS"
  5252. +  CFLAGS="$CFLAGS -c -o conftest.lo"
  5253. +  echo "$progname:788: checking if $compiler supports -c -o file.lo" >&5
  5254. +if { (eval echo $progname:789: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then
  5255. +
  5256. +    # The compiler can only warn and ignore the option if not recognized
  5257. +    # So say no if there are warnings
  5258. +      if test -s conftest.err; then
  5259. +    echo "$ac_t"no 1>&6
  5260. +    compiler_o_lo=no
  5261. +      else
  5262. +    echo "$ac_t"yes 1>&6
  5263. +    compiler_o_lo=yes
  5264. +      fi
  5265.    else
  5266.      # Append any errors to the config.log.
  5267.      cat conftest.err 1>&5
  5268. -    can_build_shared=no
  5269. -    pic_flag=
  5270. +    compiler_o_lo=no
  5271.      echo "$ac_t"no 1>&6
  5272.    fi
  5273.    CFLAGS="$save_CFLAGS"
  5274.    $rm conftest*
  5275.  else
  5276. -  echo "$ac_t"none 1>&6
  5277. +  compiler_o_lo=no
  5278. +fi
  5279. +
  5280. +# Check to see if we can do hard links to lock some files if needed
  5281. +hard_links="nottested"
  5282. +if test "$compiler_c_o" = no && test "$need_locks" != no; then
  5283. +  # do not overwrite the value of need_locks provided by the user
  5284. +  echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6
  5285. +  hard_links=yes
  5286. +  $rm conftest*
  5287. +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5288. +  touch conftest.a
  5289. +  ln conftest.a conftest.b 2>&5 || hard_links=no
  5290. +  ln conftest.a conftest.b 2>/dev/null && hard_links=no
  5291. +  echo "$ac_t$hard_links" 1>&6
  5292. +  $rm conftest*
  5293. +  if test "$hard_links" = no; then
  5294. +    echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2
  5295. +    need_locks=warn
  5296. +  fi
  5297. +else
  5298. +  need_locks=no
  5299. +fi
  5300. +
  5301. +if test "$with_gcc" = yes; then
  5302. +  # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
  5303. +  echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6
  5304. +  $rm conftest*
  5305. +  echo "int some_variable = 0;" > conftest.c
  5306. +  save_CFLAGS="$CFLAGS"
  5307. +  CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c"
  5308. +  echo "$progname:840: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
  5309. +  if { (eval echo $progname:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then
  5310. +
  5311. +    # The compiler can only warn and ignore the option if not recognized
  5312. +    # So say no if there are warnings
  5313. +      if test -s conftest.err; then
  5314. +    echo "$ac_t"no 1>&6
  5315. +    compiler_rtti_exceptions=no
  5316. +      else
  5317. +    echo "$ac_t"yes 1>&6
  5318. +    compiler_rtti_exceptions=yes
  5319. +      fi
  5320. +  else
  5321. +    # Append any errors to the config.log.
  5322. +    cat conftest.err 1>&5
  5323. +    compiler_rtti_exceptions=no
  5324. +    echo "$ac_t"no 1>&6
  5325. +  fi
  5326. +  CFLAGS="$save_CFLAGS"
  5327. +  $rm conftest*
  5328. +
  5329. +  if test "$compiler_rtti_exceptions" = "yes"; then
  5330. +    no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
  5331. +  else
  5332. +    no_builtin_flag=' -fno-builtin'
  5333. +  fi
  5334. +  
  5335.  fi
  5336.  
  5337.  # Check for any special shared library compilation flags.
  5338. @@ -577,8 +881,8 @@
  5339.  echo 'main(){return(0);}' > conftest.c
  5340.  save_LDFLAGS="$LDFLAGS"
  5341.  LDFLAGS="$LDFLAGS $link_static_flag"
  5342. -echo "$progname:580: checking if $compiler static flag $link_static_flag works" >&5
  5343. -if { (eval echo $progname:581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5344. +echo "$progname:884: checking if $compiler static flag $link_static_flag works" >&5
  5345. +if { (eval echo $progname:885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  5346.    echo "$ac_t$link_static_flag" 1>&6
  5347.  else
  5348.    echo "$ac_t"none 1>&6
  5349. @@ -610,15 +914,21 @@
  5350.    if test "$with_gcc" = yes; then
  5351.      # Check if gcc -print-prog-name=ld gives a path.
  5352.      echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6
  5353. -    echo "$progname:613: checking for ld used by GCC" >&5
  5354. +    echo "$progname:917: checking for ld used by GCC" >&5
  5355.      ac_prog=`($CC -print-prog-name=ld) 2>&5`
  5356.      case "$ac_prog" in
  5357.      # Accept absolute paths.
  5358. -    /*)
  5359. +    /* | [A-Za-z]:[\\/]*)
  5360. +      re_direlt='/[^/][^/]*/\.\./'
  5361. +      # Canonicalize the path of ld
  5362. +      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  5363. +      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  5364. +    ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  5365. +      done
  5366.        test -z "$LD" && LD="$ac_prog"
  5367.        ;;
  5368.      "")
  5369. -      # If it fails, then pretend we aren't using GCC.
  5370. +      # If it fails, then pretend we are not using GCC.
  5371.        ac_prog=ld
  5372.        ;;
  5373.      *)
  5374. @@ -628,14 +938,14 @@
  5375.      esac
  5376.    elif test "$with_gnu_ld" = yes; then
  5377.      echo $ac_n "checking for GNU ld... $ac_c" 1>&6
  5378. -    echo "$progname:631: checking for GNU ld" >&5
  5379. +    echo "$progname:941: checking for GNU ld" >&5
  5380.    else
  5381.      echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
  5382. -    echo "$progname:634: checking for non-GNU ld" >&5
  5383. +    echo "$progname:944: checking for non-GNU ld" >&5
  5384.    fi
  5385.  
  5386.    if test -z "$LD"; then
  5387. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  5388. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5389.      for ac_dir in $PATH; do
  5390.        test -z "$ac_dir" && ac_dir=.
  5391.        if test -f "$ac_dir/$ac_prog"; then
  5392. @@ -665,7 +975,7 @@
  5393.    fi
  5394.  fi
  5395.  
  5396. -# Check to see if it really is or isn't GNU ld.
  5397. +# Check to see if it really is or is not GNU ld.
  5398.  echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6
  5399.  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
  5400.  if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  5401. @@ -679,50 +989,147 @@
  5402.  echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6
  5403.  
  5404.  allow_undefined_flag=
  5405. +no_undefined_flag=
  5406. +need_lib_prefix=unknown
  5407. +need_version=unknown
  5408. +# when you set need_version to no, make sure it does not cause -set_version
  5409. +# flags to be left without arguments
  5410.  archive_cmds=
  5411. +archive_expsym_cmds=
  5412.  old_archive_from_new_cmds=
  5413.  export_dynamic_flag_spec=
  5414. +whole_archive_flag_spec=
  5415. +thread_safe_flag_spec=
  5416.  hardcode_libdir_flag_spec=
  5417.  hardcode_libdir_separator=
  5418.  hardcode_direct=no
  5419.  hardcode_minus_L=no
  5420. -hardcode_runpath_var=no
  5421.  hardcode_shlibpath_var=unsupported
  5422.  runpath_var=
  5423. +always_export_symbols=no
  5424. +export_symbols_cmds='$NM $libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
  5425. +# include_expsyms should be a list of space-separated symbols to be *always*
  5426. +# included in the symbol list
  5427. +include_expsyms=
  5428. +# exclude_expsyms can be an egrep regular expression of symbols to exclude
  5429. +# it will be wrapped by ` (' and `)$', so one must not match beginning or
  5430. +# end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
  5431. +# as well as any symbol that contains `d'.
  5432. +exclude_expsyms=
  5433.  
  5434.  case "$host_os" in
  5435. -amigaos* | sunos4*)
  5436. -  # On these operating systems, we should treat GNU ld like the system ld.
  5437. -  gnu_ld_acts_native=yes
  5438. +cygwin* | mingw*)
  5439. +  # FIXME: the MSVC++ port hasn't been tested in a loooong time
  5440. +  # When not using gcc, we currently assume that we are using
  5441. +  # Microsoft Visual C++.
  5442. +  if test "$with_gcc" != yes; then
  5443. +    with_gnu_ld=no
  5444. +  fi
  5445.    ;;
  5446. -*)
  5447. -  gnu_ld_acts_native=no
  5448. +
  5449. +freebsd2* | sunos4*)
  5450. +  exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
  5451.    ;;
  5452. +
  5453.  esac
  5454.  
  5455.  ld_shlibs=yes
  5456. -if test "$with_gnu_ld" = yes && test "$gnu_ld_acts_native" != yes; then
  5457. +if test "$with_gnu_ld" = yes; then
  5458. +  # If archive_cmds runs LD, not CC, wlarc should be empty
  5459. +  wlarc='${wl}'
  5460.  
  5461.    # See if GNU ld supports shared libraries.
  5462. -  if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5463. -    archive_cmds='$CC -shared ${wl}-soname $wl$soname -o $lib$libobjs'
  5464. -    runpath_var=LD_RUN_PATH
  5465. -    hardcode_runpath_var=yes
  5466. -    ld_shlibs=yes
  5467. -  else
  5468. +  case "$host_os" in
  5469. +  aix3* | aix4*)
  5470. +    # On AIX, the GNU linker is very broken
  5471.      ld_shlibs=no
  5472. -  fi
  5473. +    cat <<EOF 1>&2
  5474. +
  5475. +*** Warning: the GNU linker, at least up to release 2.9.1, is reported
  5476. +*** to be unable to reliably create shared libraries on AIX.
  5477. +*** Therefore, libtool is disabling shared libraries support.  If you
  5478. +*** really care for shared libraries, you may want to modify your PATH
  5479. +*** so that a non-GNU linker is found, and then restart.
  5480. +
  5481. +EOF
  5482. +    ;;
  5483. +
  5484. +  amigaos*)
  5485. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5486. +    hardcode_libdir_flag_spec='-L$libdir'
  5487. +    hardcode_minus_L=yes
  5488. +    ;;
  5489. +
  5490. +  sunos4*)
  5491. +    archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  5492. +    wlarc=
  5493. +    hardcode_direct=yes
  5494. +    hardcode_minus_L=yes
  5495. +    hardcode_shlibpath_var=no
  5496. +    ;;
  5497. +
  5498. +  beos*)
  5499. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5500. +      archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  5501. +    else
  5502. +      ld_shlibs=no
  5503. +    fi
  5504. +    ;;
  5505. +
  5506. +  cygwin* | mingw*)
  5507. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  5508. +    # no search path for DLLs.
  5509. +    hardcode_libdir_flag_spec='-L$libdir'
  5510. +    allow_undefined_flag=unsupported
  5511. +    always_export_symbols=yes
  5512. +
  5513. +    # Extract the symbol export list from an `--export-all' def file,
  5514. +    # then regenerate the def file from the symbol export list, so that
  5515. +    # the compiled dll only exports the symbol export list.
  5516. +    export_symbols_cmds='rm -f $objdir/$soname-ltdll.c~
  5517. +      sed -e "/^# \/\* ltdll.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~
  5518. +      (cd $objdir && $CC -c $soname-ltdll.c)~
  5519. +      $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def  $objdir/$soname-ltdll.$objext $libobjs~
  5520. +      sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]* ; *//" < $objdir/$soname-def > $export_symbols'
  5521. +
  5522. +    archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~
  5523. +      _lt_hint=1;
  5524. +      for symbol in `cat $export_symbols`; do
  5525. +        echo "    \$symbol @ \$_lt_hint ; " >> $objdir/$soname-def;
  5526. +    _lt_hint=`expr 1 + \$_lt_hint`;
  5527. +      done~
  5528. +      $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  5529. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  5530. +      $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~
  5531. +      $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~
  5532. +      $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts'
  5533. +
  5534. +      old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a'
  5535. +    ;;
  5536. +
  5537. +  *)
  5538. +    if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
  5539. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib'
  5540. +      archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
  5541. +    else
  5542. +      ld_shlibs=no
  5543. +    fi
  5544. +    ;;
  5545. +  esac
  5546.  
  5547.    if test "$ld_shlibs" = yes; then
  5548. -    hardcode_libdir_flag_spec='${wl}-rpath $wl$libdir'
  5549. -    export_dynamic_flag_spec='${wl}-export-dynamic'
  5550. +    runpath_var=LD_RUN_PATH
  5551. +    hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
  5552. +    export_dynamic_flag_spec='${wl}--export-dynamic'
  5553. +    whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
  5554.    fi
  5555.  else
  5556.    # PORTME fill in a description of your system's linker (not GNU ld)
  5557.    case "$host_os" in
  5558.    aix3*)
  5559.      allow_undefined_flag=unsupported
  5560. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$LD -o $objdir/$soname$libobjs -bE:$lib.exp -T512 -H512 -bM:SRE;$AR cru $lib $objdir/$soname'
  5561. +    always_export_symbols=yes
  5562. +    archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname'
  5563.      # Note: this linker hardcodes the directories in LIBPATH if there
  5564.      # are no directories specified by -L.
  5565.      hardcode_minus_L=yes
  5566. @@ -734,57 +1141,99 @@
  5567.      ;;
  5568.  
  5569.    aix4*)
  5570. -    allow_undefined_flag=unsupported
  5571. -    archive_cmds='$NM$libobjs | $global_symbol_pipe | sed '\''s/.* //'\'' > $lib.exp;$CC -o $objdir/$soname$libobjs ${wl}-bE:$lib.exp ${wl}-bM:SRE ${wl}-bnoentry;$AR cru $lib $objdir/$soname'
  5572. -    hardcode_direct=yes
  5573. +    allow_undefined_flag=
  5574. +    if test "$with_gcc" = yes; then
  5575. +      if strings `${CC} -print-prog-name=collect2` | \
  5576. +     grep resolve_lib_name >/dev/null
  5577. +      then
  5578. +    # We have reworked collect2
  5579. +    hardcode_direct=yes
  5580. +      else
  5581. +    # We have old collect2
  5582. +    hardcode_direct=unsupported
  5583. +      fi
  5584. +      archive_cmds='$CC -shared ${wl}-bnoentry -o $objdir/$soname $libobjs $deplibs $linkopts'
  5585. +    else
  5586. +      always_export_symbols=yes
  5587. +      archive_expsym_cmds='$CC -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bM:SRE ${wl}-bnoentry'
  5588. +      hardcode_direct=yes
  5589. +    fi
  5590.      hardcode_minus_L=yes
  5591. -    ;;
  5592. +    # Though LIBPATH variable hardcodes shlibpath into executable,
  5593. +    # it doesn't affect searching for -l* libraries; this confuses
  5594. +    # tests in mdemo.
  5595. +    hardcode_shlibpath_var=unsupported
  5596. +    hardcode_libdir_flag_spec='-L$libdir'
  5597. +   ;;
  5598.  
  5599.    amigaos*)
  5600. -    archive_cmds='$rm $objdir/a2ixlibrary.data;$echo "#define NAME $libname" > $objdir/a2ixlibrary.data;$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data;$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data;$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data;$AR cru $lib$libobjs;$RANLIB $lib;(cd $objdir && a2ixlibrary -32)'
  5601. +    archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)'
  5602.      hardcode_libdir_flag_spec='-L$libdir'
  5603.      hardcode_minus_L=yes
  5604.      ;;
  5605.  
  5606. +  cygwin* | mingw*)
  5607. +    # When not using gcc, we currently assume that we are using
  5608. +    # Microsoft Visual C++.
  5609. +    # hardcode_libdir_flag_spec is actually meaningless, as there is
  5610. +    # no search path for DLLs.
  5611. +    hardcode_libdir_flag_spec=' '
  5612. +    allow_undefined_flag=unsupported
  5613. +    # Tell ltmain to make .lib files, not .a files.
  5614. +    libext=lib
  5615. +    # FIXME: Setting linknames here is a bad hack.
  5616. +    archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
  5617. +    # The linker will automatically build a .lib file if we build a DLL.
  5618. +    old_archive_from_new_cmds='true'
  5619. +    # FIXME: Should let the user specify the lib program.
  5620. +    old_archive_cmds='lib /OUT:$oldlib$oldobjs'
  5621. +    fix_srcfile_path='`cygpath -w $srcfile`'
  5622. +    ;;
  5623. +
  5624. +  freebsd1*)
  5625. +    ld_shlibs=no
  5626. +    can_build_shared=no
  5627. +    ;;
  5628. +
  5629.    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
  5630.    # support.  Future versions do this automatically, but an explicit c++rt0.o
  5631. -  # doesn't break anything, and helps significantly (at the cost of a little
  5632. +  # does not break anything, and helps significantly (at the cost of a little
  5633.    # extra space).
  5634.    freebsd2.2*)
  5635. -    archive_cmds='$LD -Bshareable -o $lib$libobjs /usr/lib/c++rt0.o'
  5636. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o'
  5637.      hardcode_libdir_flag_spec='-R$libdir'
  5638.      hardcode_direct=yes
  5639. -    hardcode_minus_L=yes
  5640. +    hardcode_minus_L=no # verified on 2.2.6
  5641.      hardcode_shlibpath_var=no
  5642.      ;;
  5643.  
  5644. -  # Unfortunately, older versions of FreeBSD 2 don't have this feature.
  5645. +  # Unfortunately, older versions of FreeBSD 2 do not have this feature.
  5646.    freebsd2*)
  5647. -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
  5648. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5649.      hardcode_direct=yes
  5650.      hardcode_minus_L=yes
  5651.      hardcode_shlibpath_var=no
  5652.      ;;
  5653.  
  5654. -  # FreeBSD 3, at last, uses gcc -shared to do shared libraries.
  5655. -  freebsd3*)
  5656. -    archive_cmds='$CC -shared -o $lib$libobjs'
  5657. +  # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
  5658. +  freebsd*)
  5659. +    archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts'
  5660.      hardcode_libdir_flag_spec='-R$libdir'
  5661.      hardcode_direct=yes
  5662. -    hardcode_minus_L=yes
  5663. +    hardcode_minus_L=no
  5664.      hardcode_shlibpath_var=no
  5665.      ;;
  5666.  
  5667.    hpux9*)
  5668. -    archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
  5669. +    archive_cmds='$rm $objdir/$soname~$LD -b +s +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib'
  5670.      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5671.      hardcode_direct=yes
  5672.      hardcode_minus_L=yes
  5673.      export_dynamic_flag_spec='${wl}-E'
  5674.      ;;
  5675.  
  5676. -  hpux10*)
  5677. -    archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib$libobjs'
  5678. +  hpux10* | hpux11*)
  5679. +    archive_cmds='$LD -b +h $soname +s +b $install_libdir -o $lib $libobjs $deplibs $linkopts'
  5680.      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
  5681.      hardcode_direct=yes
  5682.      hardcode_minus_L=yes
  5683. @@ -792,20 +1241,28 @@
  5684.      ;;
  5685.  
  5686.    irix5* | irix6*)
  5687. -    archive_cmds='$LD -shared -o $lib -soname $soname -set_version $verstring$libobjs'
  5688. +    if test "$with_gcc" = yes; then
  5689. +      archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  5690. +    else
  5691. +      archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  5692. +    fi
  5693.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5694. +    hardcode_libdir_separator=:
  5695.      ;;
  5696.  
  5697.    netbsd*)
  5698. -    # Tested with NetBSD 1.2 ld
  5699. -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
  5700. -    hardcode_libdir_flag_spec='-R$libdir'
  5701. +    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  5702. +      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'  # a.out
  5703. +    else
  5704. +      archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts'      # ELF
  5705. +    fi
  5706. +    hardcode_libdir_flag_spec='${wl}-R$libdir'
  5707.      hardcode_direct=yes
  5708.      hardcode_shlibpath_var=no
  5709.      ;;
  5710.  
  5711.    openbsd*)
  5712. -    archive_cmds='$LD -Bshareable -o $lib$libobjs'
  5713. +    archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts'
  5714.      hardcode_libdir_flag_spec='-R$libdir'
  5715.      hardcode_direct=yes
  5716.      hardcode_shlibpath_var=no
  5717. @@ -815,37 +1272,45 @@
  5718.      hardcode_libdir_flag_spec='-L$libdir'
  5719.      hardcode_minus_L=yes
  5720.      allow_undefined_flag=unsupported
  5721. -    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def;$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def;$echo DATA >> $objdir/$libname.def;$echo " SINGLE NONSHARED" >> $objdir/$libname.def;$echo EXPORTS >> $objdir/$libname.def;emxexp$libobjs >> $objdir/$libname.def;$CC -Zdll -Zcrtdll -o $lib$libobjs $objdir/$libname.def'
  5722. +    archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def'
  5723.      old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def'
  5724.      ;;
  5725.  
  5726.    osf3* | osf4*)
  5727. -    allow_undefined_flag=' -expect_unresolved \*'
  5728. -    archive_cmds='$LD -shared${allow_undefined_flag} -o $lib -soname $soname -set_version $verstring$libobjs$deplibs'
  5729. +    if test "$with_gcc" = yes; then
  5730. +      allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
  5731. +      archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
  5732. +    else
  5733. +      allow_undefined_flag=' -expect_unresolved \*'
  5734. +      archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -o $lib'
  5735. +    fi
  5736.      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
  5737.      hardcode_libdir_separator=:
  5738.      ;;
  5739.  
  5740.    sco3.2v5*)
  5741. -    archive_cmds='$LD -G -o $lib$libobjs'
  5742. +    archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts'
  5743.      hardcode_direct=yes
  5744.      ;;
  5745.  
  5746. -  solaris2*)
  5747. -    archive_cmds='$LD -G -z text -h $soname -o $lib$libobjs'
  5748. +  solaris*)
  5749. +    no_undefined_flag=' -z text'
  5750. +    # $CC -shared without GNU ld will not create a library from C++
  5751. +    # object files and a static libstdc++, better avoid it by now
  5752. +    archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts'
  5753. +    archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
  5754. +        $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp'
  5755.      hardcode_libdir_flag_spec='-R$libdir'
  5756.      hardcode_shlibpath_var=no
  5757.      ;;
  5758.  
  5759.    sunos4*)
  5760. +    # Why do we need -Bstatic?  To avoid inter-library dependencies, maybe...
  5761.      if test "$with_gcc" = yes; then
  5762. -      archive_cmds='$CC -shared -o $lib$libobjs'
  5763. +      # Use -fPIC here because libgcc is multilibbed
  5764. +      archive_cmds='$CC -shared ${wl}-Bstatic -fPIC -o $lib $libobjs $deplibs $linkopts'
  5765.      else
  5766. -      archive_cmds='$LD -assert pure-text -Bstatic -o $lib$libobjs'
  5767. -    fi
  5768. -
  5769. -    if test "$with_gnu_ld" = yes; then
  5770. -      export_dynamic_flag_spec='${wl}-export-dynamic'
  5771. +      archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts'
  5772.      fi
  5773.      hardcode_libdir_flag_spec='-L$libdir'
  5774.      hardcode_direct=yes
  5775. @@ -853,13 +1318,29 @@
  5776.      hardcode_shlibpath_var=no
  5777.      ;;
  5778.  
  5779. -   uts4*)
  5780. -     archive_cmds='$LD -G -h $soname -o $lib$libobjs'
  5781. -     hardcode_libdir_flag_spec='-L$libdir'
  5782. -     hardcode_direct=no
  5783. -     hardcode_minus_L=no
  5784. -     hardcode_shlibpath_var=no
  5785. -     ;;
  5786. +  sysv4.3*)
  5787. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5788. +    hardcode_direct=no
  5789. +    hardcode_minus_L=no
  5790. +    hardcode_shlibpath_var=no
  5791. +    export_dynamic_flag_spec='-Bexport'
  5792. +    ;;
  5793. +
  5794. +  uts4*)
  5795. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5796. +    hardcode_libdir_flag_spec='-L$libdir'
  5797. +    hardcode_direct=no
  5798. +    hardcode_minus_L=no
  5799. +    hardcode_shlibpath_var=no
  5800. +    ;;
  5801. +
  5802. +  dgux*)
  5803. +    archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts'
  5804. +    hardcode_libdir_flag_spec='-L$libdir'
  5805. +    hardcode_direct=no
  5806. +    hardcode_minus_L=no
  5807. +    hardcode_shlibpath_var=no
  5808. +    ;;
  5809.  
  5810.    *)
  5811.      ld_shlibs=no
  5812. @@ -872,23 +1353,25 @@
  5813.  if test -z "$NM"; then
  5814.    echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6
  5815.    case "$NM" in
  5816. -  /*) ;; # Let the user override the test with a path.
  5817. +  /* | [A-Za-z]:[/\\]*) ;; # Let the user override the test with a path.
  5818.    *)
  5819. -    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
  5820. -    for ac_dir in /usr/ucb /usr/ccs/bin $PATH /bin; do
  5821. -      test -z "$ac_dir" && dir=.
  5822. +    IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
  5823. +    for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do
  5824. +      test -z "$ac_dir" && ac_dir=.
  5825.        if test -f $ac_dir/nm; then
  5826. -        # Check to see if the nm accepts a BSD-compat flag.
  5827. -        # Adding the `sed 1!d' prevents false positives on HP-UX, which says:
  5828. -        #   nm: unknown option "B" ignored
  5829. -        if ($ac_dir/nm -B /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
  5830. -          NM="$ac_dir/nm -B"
  5831. -        elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1!d'; exit 0) | egrep /dev/null >/dev/null; then
  5832. -          NM="$ac_dir/nm -p"
  5833. +    # Check to see if the nm accepts a BSD-compat flag.
  5834. +    # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  5835. +    #   nm: unknown option "B" ignored
  5836. +    if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5837. +      NM="$ac_dir/nm -B"
  5838. +      break
  5839. +    elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  5840. +      NM="$ac_dir/nm -p"
  5841. +      break
  5842.      else
  5843. -          NM="$ac_dir/nm"
  5844. +      NM=${NM="$ac_dir/nm"} # keep the first match, but
  5845. +      continue # so that we can try to find one that supports BSD flags
  5846.      fi
  5847. -        break
  5848.        fi
  5849.      done
  5850.      IFS="$ac_save_ifs"
  5851. @@ -905,40 +1388,51 @@
  5852.  # [They come from Ultrix.  What could be older than Ultrix?!! ;)]
  5853.  
  5854.  # Character class describing NM global symbol codes.
  5855. -symcode='[BCDEGRSTU]'
  5856. +symcode='[BCDEGRST]'
  5857.  
  5858.  # Regexp to match symbols that can be accessed directly from C.
  5859.  sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
  5860.  
  5861.  # Transform the above into a raw symbol and a C symbol.
  5862. -symxfrm='\1 \1'
  5863. +symxfrm='\1 \2\3 \3'
  5864. +
  5865. +# Transform an extracted symbol line into a proper C declaration
  5866. +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5867.  
  5868.  # Define system-specific variables.
  5869.  case "$host_os" in
  5870.  aix*)
  5871. -  symcode='[BCDTU]'
  5872. +  symcode='[BCDT]'
  5873. +  ;;
  5874. +cygwin* | mingw*)
  5875. +  symcode='[ABCDGISTW]'
  5876. +  ;;
  5877. +hpux*) # Its linker distinguishes data from code symbols
  5878. +  global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
  5879.    ;;
  5880.  irix*)
  5881. -  # Cannot use undefined symbols on IRIX because inlined functions mess us up.
  5882.    symcode='[BCDEGRST]'
  5883.    ;;
  5884. -solaris2*)
  5885. -  symcode='[BDTU]'
  5886. +solaris*)
  5887. +  symcode='[BDT]'
  5888.    ;;
  5889.  esac
  5890.  
  5891.  # If we're using GNU nm, then use its standard symbol codes.
  5892.  if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then
  5893. -  symcode='[ABCDGISTUW]'
  5894. +  symcode='[ABCDGISTW]'
  5895.  fi
  5896.  
  5897. -# Write the raw and C identifiers.
  5898. -global_symbol_pipe="sed -n -e 's/^.* $symcode $sympat$/$symxfrm/p'"
  5899. +# Try without a prefix undercore, then with it.
  5900. +for ac_symprfx in "" "_"; do
  5901.  
  5902. -# Check to see that the pipe works correctly.
  5903. -pipe_works=no
  5904. -$rm conftest*
  5905. -cat > conftest.c <<EOF
  5906. +  # Write the raw and C identifiers.
  5907. +  global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode\)[     ][     ]*\($ac_symprfx\)$sympat$/$symxfrm/p'"
  5908. +
  5909. +  # Check to see that the pipe works correctly.
  5910. +  pipe_works=no
  5911. +  $rm conftest*
  5912. +  cat > conftest.c <<EOF
  5913.  #ifdef __cplusplus
  5914.  extern "C" {
  5915.  #endif
  5916. @@ -950,99 +1444,102 @@
  5917.  main(){nm_test_var='a';nm_test_func();return(0);}
  5918.  EOF
  5919.  
  5920. -echo "$progname:953: checking if global_symbol_pipe works" >&5
  5921. -if { (eval echo $progname:954: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then
  5922. -  # Now try to grab the symbols.
  5923. -  nlist=conftest.nm
  5924. -  if { echo "$progname:957: eval \"$NM conftest.o | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.o | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5925. -
  5926. -    # Try sorting and uniquifying the output.
  5927. -    if sort "$nlist" | uniq > "$nlist"T; then
  5928. -      mv -f "$nlist"T "$nlist"
  5929. -      wcout=`wc "$nlist" 2>/dev/null`
  5930. -      count=`echo "$wcout" | sed 's/^[     ]*\([0-9][0-9]*\).*$/\1/'`
  5931. -      (test "$count" -ge 0) 2>/dev/null || count=-1
  5932. -    else
  5933. -      rm -f "$nlist"T
  5934. -      count=-1
  5935. -    fi
  5936. +  echo "$progname:1447: checking if global_symbol_pipe works" >&5
  5937. +  if { (eval echo $progname:1448: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then
  5938. +    # Now try to grab the symbols.
  5939. +    nlist=conftest.nm
  5940. +    if { echo "$progname:1451: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then
  5941. +
  5942. +      # Try sorting and uniquifying the output.
  5943. +      if sort "$nlist" | uniq > "$nlist"T; then
  5944. +    mv -f "$nlist"T "$nlist"
  5945. +      else
  5946. +    rm -f "$nlist"T
  5947. +      fi
  5948.  
  5949. -    # Make sure that we snagged all the symbols we need.
  5950. -    if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5951. -      if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5952. -    cat <<EOF > conftest.c
  5953. +      # Make sure that we snagged all the symbols we need.
  5954. +      if egrep ' nm_test_var$' "$nlist" >/dev/null; then
  5955. +    if egrep ' nm_test_func$' "$nlist" >/dev/null; then
  5956. +      cat <<EOF > conftest.c
  5957.  #ifdef __cplusplus
  5958.  extern "C" {
  5959.  #endif
  5960.  
  5961.  EOF
  5962. -        # Now generate the symbol file.
  5963. -        sed 's/^.* \(.*\)$/extern char \1;/' < "$nlist" >> conftest.c
  5964. +      # Now generate the symbol file.
  5965. +      eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c'
  5966.  
  5967. -    cat <<EOF >> conftest.c
  5968. +      cat <<EOF >> conftest.c
  5969.  #if defined (__STDC__) && __STDC__
  5970. -# define __ptr_t void *
  5971. +# define lt_ptr_t void *
  5972.  #else
  5973. -# define __ptr_t char *
  5974. +# define lt_ptr_t char *
  5975. +# define const
  5976.  #endif
  5977.  
  5978. -/* The number of symbols in dld_preloaded_symbols, -1 if unsorted. */
  5979. -int dld_preloaded_symbol_count = $count;
  5980. -
  5981.  /* The mapping between symbol names and symbols. */
  5982. -struct {
  5983. -  char *name;
  5984. -  __ptr_t address;
  5985. +const struct {
  5986. +  const char *name;
  5987. +  lt_ptr_t address;
  5988.  }
  5989. -dld_preloaded_symbols[] =
  5990. +lt_preloaded_symbols[] =
  5991.  {
  5992.  EOF
  5993. -        sed 's/^\(.*\) \(.*\)$/  {"\1", (__ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5994. -        cat <<\EOF >> conftest.c
  5995. -  {0},
  5996. +      sed 's/^. \(.*\) \(.*\)$/  {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c
  5997. +      cat <<\EOF >> conftest.c
  5998. +  {0, (lt_ptr_t) 0}
  5999.  };
  6000.  
  6001.  #ifdef __cplusplus
  6002.  }
  6003.  #endif
  6004.  EOF
  6005. -        # Now try linking the two files.
  6006. -        mv conftest.o conftestm.o
  6007. -    save_LIBS="$LIBS"
  6008. -    save_CFLAGS="$CFLAGS"
  6009. -        LIBS='conftestm.o'
  6010. -    CFLAGS="$CFLAGS$no_builtin_flag"
  6011. -        if { (eval echo $progname:1015: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  6012. -          pipe_works=yes
  6013. -        else
  6014. -          echo "$progname: failed program was:" >&5
  6015. -          cat conftest.c >&5
  6016. -        fi
  6017. -        LIBS="$save_LIBS"
  6018. +      # Now try linking the two files.
  6019. +      mv conftest.$objext conftestm.$objext
  6020. +      save_LIBS="$LIBS"
  6021. +      save_CFLAGS="$CFLAGS"
  6022. +      LIBS="conftestm.$objext"
  6023. +      CFLAGS="$CFLAGS$no_builtin_flag"
  6024. +      if { (eval echo $progname:1503: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  6025. +        pipe_works=yes
  6026. +      else
  6027. +        echo "$progname: failed program was:" >&5
  6028. +        cat conftest.c >&5
  6029. +      fi
  6030. +      LIBS="$save_LIBS"
  6031. +    else
  6032. +      echo "cannot find nm_test_func in $nlist" >&5
  6033. +    fi
  6034.        else
  6035. -        echo "cannot find nm_test_func in $nlist" >&5
  6036. +    echo "cannot find nm_test_var in $nlist" >&5
  6037.        fi
  6038.      else
  6039. -      echo "cannot find nm_test_var in $nlist" >&5
  6040. +      echo "cannot run $global_symbol_pipe" >&5
  6041.      fi
  6042.    else
  6043. -    echo "cannot run $global_symbol_pipe" >&5
  6044. +    echo "$progname: failed program was:" >&5
  6045. +    cat conftest.c >&5
  6046.    fi
  6047. -else
  6048. -  echo "$progname: failed program was:" >&5
  6049. -  cat conftest.c >&5
  6050. -fi
  6051. -$rm conftest*
  6052. +  $rm conftest*
  6053.  
  6054. -# Don't use the global_symbol_pipe unless it works.
  6055. +  # Do not use the global_symbol_pipe unless it works.
  6056. +  if test "$pipe_works" = yes; then
  6057. +    break
  6058. +  else
  6059. +    global_symbol_pipe=
  6060. +  fi
  6061. +done
  6062.  echo "$ac_t$pipe_works" 1>&6
  6063. -test "$pipe_works" = yes || global_symbol_pipe=
  6064. +
  6065. +if test -z "$global_symbol_pipe"; then
  6066. +  global_symbol_to_cdecl=
  6067. +fi
  6068.  
  6069.  # Check hardcoding attributes.
  6070.  echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6
  6071.  hardcode_action=
  6072.  if test -n "$hardcode_libdir_flag_spec" || \
  6073. -   test "$hardcode_runpath_var" = yes; then
  6074. +   test -n "$runpath_var"; then
  6075.  
  6076.    # We can hardcode non-existant directories.
  6077.    if test "$hardcode_direct" != no && \
  6078. @@ -1055,25 +1552,20 @@
  6079.      # We can link without hardcoding, and we can hardcode nonexisting dirs.
  6080.      hardcode_action=immediate
  6081.    fi
  6082. -elif test "$hardcode_direct" != yes && \
  6083. -     test "$hardcode_minus_L" != yes && \
  6084. -     test "$hardcode_shlibpath_var" != yes; then
  6085. -  # We can't hardcode anything.
  6086. -  hardcode_action=unsupported
  6087.  else
  6088. -  # We can only hardcode existing directories.
  6089. -  hardcode_action=relink
  6090. +  # We cannot hardcode anything, or else we can only hardcode existing
  6091. +  # directories.
  6092. +  hardcode_action=unsupported
  6093.  fi
  6094.  echo "$ac_t$hardcode_action" 1>&6
  6095. -test "$hardcode_action" = unsupported && can_build_shared=no
  6096.  
  6097.  
  6098.  reload_flag=
  6099.  reload_cmds='$LD$reload_flag -o $output$reload_objs'
  6100.  echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6
  6101. -# PORTME Some linker may need a different reload flag.
  6102. +# PORTME Some linkers may need a different reload flag.
  6103.  reload_flag='-r'
  6104. -echo "$ac_t$reload_flag"
  6105. +echo "$ac_t$reload_flag" 1>&6
  6106.  test -n "$reload_flag" && reload_flag=" $reload_flag"
  6107.  
  6108.  # PORTME Fill in your ld.so characteristics
  6109. @@ -1085,58 +1577,172 @@
  6110.  finish_cmds=
  6111.  finish_eval=
  6112.  shlibpath_var=
  6113. +shlibpath_overrides_runpath=unknown
  6114.  version_type=none
  6115.  dynamic_linker="$host_os ld.so"
  6116. -
  6117. +sys_lib_dlsearch_path_spec="/lib /usr/lib"
  6118. +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
  6119. +file_magic_cmd=
  6120. +file_magic_test_file=
  6121. +deplibs_check_method='unknown'
  6122. +# Need to set the preceding variable on all platforms that support
  6123. +# interlibrary dependencies.
  6124. +# 'none' -- dependencies not supported.
  6125. +# `unknown' -- same as none, but documents that we really don't know.
  6126. +# 'pass_all' -- all dependencies passed with no checks.
  6127. +# 'test_compile' -- check by making test program.
  6128. +# 'file_magic [regex]' -- check by looking for files in library path
  6129. +# which responds to the $file_magic_cmd with a given egrep regex.
  6130. +# If you have `file' or equivalent on your system and you're not sure
  6131. +# whether `pass_all' will *always* work, you probably want this one.
  6132.  echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6
  6133.  case "$host_os" in
  6134. -aix3* | aix4*)
  6135. +aix3*)
  6136.    version_type=linux
  6137. -  library_names_spec='$libname.so.$versuffix $libname.a'
  6138. +  library_names_spec='${libname}${release}.so$versuffix $libname.a'
  6139.    shlibpath_var=LIBPATH
  6140.  
  6141.    # AIX has no versioning support, so we append a major version to the name.
  6142. -  soname_spec='$libname.so.$major'
  6143. +  soname_spec='${libname}${release}.so$major'
  6144. +  ;;
  6145. +
  6146. +aix4*)
  6147. +  version_type=linux
  6148. +  # AIX has no versioning support, so currently we can not hardcode correct
  6149. +  # soname into executable. Probably we can add versioning support to
  6150. +  # collect2, so additional links can be useful in future.
  6151. +  # We preserve .a as extension for shared libraries though AIX4.2
  6152. +  # and later linker supports .so
  6153. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a'
  6154. +  shlibpath_var=LIBPATH
  6155. +  deplibs_check_method=pass_all
  6156.    ;;
  6157.  
  6158.  amigaos*)
  6159.    library_names_spec='$libname.ixlibrary $libname.a'
  6160.    # Create ${libname}_ixlibrary.a entries in /sys/libs.
  6161. -  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "$lib" | sed '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  6162. +  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
  6163.    ;;
  6164.  
  6165. -freebsd2* | freebsd3*)
  6166. -  version_type=sunos
  6167. -  library_names_spec='$libname.so.$versuffix $libname.so'
  6168. -  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6169. -  shlibpath_var=LD_LIBRARY_PATH
  6170. +beos*)
  6171. +  library_names_spec='${libname}.so'
  6172. +  dynamic_linker="$host_os ld.so"
  6173. +  shlibpath_var=LIBRARY_PATH
  6174.    ;;
  6175.  
  6176. -gnu*)
  6177. -  version_type=sunos
  6178. -  library_names_spec='$libname.so.$versuffix'
  6179. +bsdi4*)
  6180. +  version_type=linux
  6181. +  library_names_spec='${libname}.so$major ${libname}.so'
  6182. +  soname_spec='${libname}.so'
  6183. +  finish_cmds='PATH="$PATH:/sbin" ldconfig $libdir'
  6184.    shlibpath_var=LD_LIBRARY_PATH
  6185. +  deplibs_check_method='file_magic ELF 32-bit LSB shared object'
  6186. +  file_magic_cmd=/usr/bin/file
  6187. +  file_magic_test_file=/shlib/libc.so
  6188. +  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
  6189. +  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
  6190. +  # the default ld.so.conf also contains /usr/contrib/lib and
  6191. +  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
  6192. +  # libtool to hard-code these into programs
  6193.    ;;
  6194.  
  6195. -hpux9* | hpux10*)
  6196. -  # Give a soname corresponding to the major version so that dld.sl refuses to
  6197. -  # link against other versions.
  6198. -  dynamic_linker="$host_os dld.sl"
  6199. -  version_type=sunos
  6200. -  shlibpath_var=SHLIB_PATH
  6201. -  library_names_spec='$libname.sl.$versuffix $libname.sl.$major $libname.sl'
  6202. -  soname_spec='$libname.sl.$major'
  6203. -  # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6204. -  postinstall_cmds='chmod 555 $lib'
  6205. +cygwin* | mingw*)
  6206. +  version_type=windows
  6207. +  if test "$with_gcc" = yes; then
  6208. +    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a'
  6209. +  else
  6210. +    library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib'
  6211. +  fi
  6212. +  dynamic_linker='Win32 ld.exe'
  6213. +  deplibs_check_method='file_magic file format pei*-i386.*architecture: i386'
  6214. +  file_magic_cmd='objdump -f'
  6215. +  need_lib_prefix=no
  6216. +  # FIXME: first we should search . and the directory the executable is in
  6217. +  shlibpath_var=PATH
  6218.    ;;
  6219.  
  6220. -irix5* | irix6*)
  6221. -  version_type=osf
  6222. -  soname_spec='$libname.so'
  6223. -  library_names_spec='$libname.so.$versuffix $libname.so'
  6224. +freebsd1*)
  6225. +  dynamic_linker=no
  6226. +  ;;
  6227. +  
  6228. +freebsd*)
  6229. +  objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
  6230. +  version_type=freebsd-$objformat
  6231. +  case "$version_type" in
  6232. +    freebsd-elf*)
  6233. +      deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
  6234. +      file_magic_cmd=/usr/bin/file
  6235. +      file_magic_test_file=`echo /usr/lib/libc.so*`
  6236. +      library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6237. +      need_version=no
  6238. +      need_lib_prefix=no
  6239. +      ;;
  6240. +    freebsd-*)
  6241. +      deplibs_check_method=unknown
  6242. +      library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
  6243. +      need_version=yes
  6244. +      ;;
  6245. +  esac
  6246. +  finish_cmds='PATH="$PATH:/sbin" OBJFORMAT="'"$objformat"'" ldconfig -m $libdir'
  6247.    shlibpath_var=LD_LIBRARY_PATH
  6248.    ;;
  6249.  
  6250. +gnu*)
  6251. +  version_type=linux
  6252. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so'
  6253. +  shlibpath_var=LD_LIBRARY_PATH
  6254. +  ;;
  6255. +
  6256. +hpux9* | hpux10* | hpux11*)
  6257. +  # Give a soname corresponding to the major version so that dld.sl refuses to
  6258. +  # link against other versions.
  6259. +  dynamic_linker="$host_os dld.sl"
  6260. +  version_type=sunos
  6261. +  need_lib_prefix=no
  6262. +  need_version=no
  6263. +  shlibpath_var=SHLIB_PATH
  6264. +  library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
  6265. +  soname_spec='${libname}${release}.sl$major'
  6266. +  # HP-UX runs *really* slowly unless shared libraries are mode 555.
  6267. +  postinstall_cmds='chmod 555 $lib'
  6268. +  ;;
  6269. +
  6270. +irix5*)
  6271. +  version_type=irix
  6272. +  soname_spec='${libname}${release}.so'
  6273. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6274. +  shlibpath_var=LD_LIBRARY_PATH
  6275. +  deplibs_check_method=pass_all
  6276. +  file_magic_cmd=/usr/bin/file
  6277. +  file_magic_test_file=`echo /lib/libc.so*`
  6278. +  shlibpath_overrides_runpath=no
  6279. +  ;;
  6280. +
  6281. +irix6*)
  6282. +  version_type=irix
  6283. +  need_lib_prefix=no
  6284. +  need_version=no
  6285. +  soname_spec='${libname}${release}.so'
  6286. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6287. +  case "$LD" in # libtool.m4 will add one of these switches to LD
  6288. +  *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;;
  6289. +  *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;;
  6290. +  *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;;
  6291. +  *) libsuff= shlibsuff= libmagic=never-match;;
  6292. +  esac
  6293. +  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
  6294. +  shlibpath_overrides_runpath=no
  6295. +  # even though /usr/local/lib is always searched, the man-page says
  6296. +  # shared libraries should not be installed there if they use an ABI
  6297. +  # different from -32, so we'd better not search for shared libraries
  6298. +  # there either
  6299. +  sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  6300. +  sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
  6301. +  deplibs_check_method=pass_all
  6302. +  file_magic_cmd=/usr/bin/file
  6303. +  file_magic_test_file=`echo /lib${libsuff}/libc.so*`
  6304. +  ;;
  6305. +
  6306.  # No shared lib support for Linux oldld, aout, or coff.
  6307.  linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
  6308.    dynamic_linker=no
  6309. @@ -1145,10 +1751,16 @@
  6310.  # This must be Linux ELF.
  6311.  linux-gnu*)
  6312.    version_type=linux
  6313. -  library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  6314. -  soname_spec='$libname.so.$major'
  6315. -  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
  6316. +  need_lib_prefix=no
  6317. +  need_version=no
  6318. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6319. +  soname_spec='${libname}${release}.so$major'
  6320. +  finish_cmds='PATH="$PATH:/sbin" ldconfig -n $libdir'
  6321.    shlibpath_var=LD_LIBRARY_PATH
  6322. +  shlibpath_overrides_runpath=no
  6323. +  deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
  6324. +  file_magic_cmd=/usr/bin/file
  6325. +  file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  6326.  
  6327.    if test -f /lib/ld.so.1; then
  6328.      dynamic_linker='GNU ld.so'
  6329. @@ -1161,15 +1773,34 @@
  6330.    fi
  6331.    ;;
  6332.  
  6333. -netbsd* | openbsd*)
  6334. +netbsd*)
  6335. +  version_type=sunos
  6336. +  if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
  6337. +    library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6338. +    finish_cmds='PATH="$PATH:/sbin" ldconfig -m $libdir'
  6339. +    dynamic_linker='NetBSD (a.out) ld.so'
  6340. +  else
  6341. +    library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
  6342. +    soname_spec='${libname}${release}.so$major'
  6343. +    dynamic_linker='NetBSD ld.elf_so'
  6344. +  fi
  6345. +  shlibpath_var=LD_LIBRARY_PATH
  6346. +  ;;
  6347. +
  6348. +openbsd*)
  6349.    version_type=sunos
  6350. -  library_names_spec='$libname.so.$versuffix'
  6351. +  if test "$with_gnu_ld" = yes; then
  6352. +    need_lib_prefix=no
  6353. +    need_version=no
  6354. +  fi
  6355. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6356.    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
  6357.    shlibpath_var=LD_LIBRARY_PATH
  6358.    ;;
  6359.  
  6360.  os2*)
  6361.    libname_spec='$name'
  6362. +  need_lib_prefix=no
  6363.    library_names_spec='$libname.dll $libname.a'
  6364.    dynamic_linker='OS/2 ld.exe'
  6365.    shlibpath_var=LIBPATH
  6366. @@ -1177,36 +1808,80 @@
  6367.  
  6368.  osf3* | osf4*)
  6369.    version_type=osf
  6370. -  soname_spec='$libname.so'
  6371. -  library_names_spec='$libname.so.$versuffix $libname.so'
  6372. +  soname_spec='${libname}${release}.so'
  6373. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
  6374.    shlibpath_var=LD_LIBRARY_PATH
  6375. +  # deplibs_check_method='pass_all'
  6376. +  # Although pass_all appears to work, it copies symbols from static libraries
  6377. +  # into shared ones and exports them.  So, when a program is linked with two
  6378. +  # or more libraries that have got copies of the same symbols, link fails
  6379. +  # This was only tested on osf4:
  6380. +  deplibs_check_method='file_magic COFF format alpha shared library'
  6381. +  file_magic_cmd=/usr/bin/file
  6382. +  file_magic_test_file=/shlib/libc.so
  6383. +  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
  6384. +  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
  6385.    ;;
  6386.  
  6387.  sco3.2v5*)
  6388.    version_type=osf
  6389. -  soname_spec='$libname.so.$major'
  6390. -  library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  6391. +  soname_spec='${libname}${release}.so$major'
  6392. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6393.    shlibpath_var=LD_LIBRARY_PATH
  6394.    ;;
  6395.  
  6396. -solaris2*)
  6397. +solaris*)
  6398.    version_type=linux
  6399. -  library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  6400. -  soname_spec='$libname.so.$major'
  6401. +  need_lib_prefix=no
  6402. +  need_version=no
  6403. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6404. +  soname_spec='${libname}${release}.so$major'
  6405.    shlibpath_var=LD_LIBRARY_PATH
  6406. +  shlibpath_overrides_runpath=yes
  6407. +  # ldd complains unless libraries are executable
  6408. +  postinstall_cmds='chmod +x $lib'
  6409. +  deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib"
  6410. +  file_magic_cmd=/usr/bin/file
  6411. +  file_magic_test_file=/lib/libc.so
  6412.    ;;
  6413.  
  6414.  sunos4*)
  6415.    version_type=sunos
  6416. -  library_names_spec='$libname.so.$versuffix'
  6417. +  library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
  6418.    finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
  6419.    shlibpath_var=LD_LIBRARY_PATH
  6420. +  shlibpath_overrides_runpath=yes
  6421. +  if test "$with_gnu_ld" = yes; then
  6422. +    need_lib_prefix=no
  6423. +  fi
  6424. +  need_version=yes
  6425. +  ;;
  6426. +
  6427. +sysv4.2uw2* | sysv4.3* | sysv5*)
  6428. +  version_type=linux
  6429. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6430. +  soname_spec='${libname}${release}.so$major'
  6431. +  shlibpath_var=LD_LIBRARY_PATH
  6432. +  case "$host_vendor" in
  6433. +    ncr)
  6434. +      deplibs_check_method='pass_all'
  6435. +      ;;
  6436. +  esac
  6437.    ;;
  6438.  
  6439.  uts4*)
  6440.    version_type=linux
  6441. -  library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
  6442. -  soname_spec='$libname.so.$major'
  6443. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6444. +  soname_spec='${libname}${release}.so$major'
  6445. +  shlibpath_var=LD_LIBRARY_PATH
  6446. +  ;;
  6447. +
  6448. +dgux*)
  6449. +  version_type=linux
  6450. +  need_lib_prefix=no
  6451. +  need_version=no
  6452. +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
  6453. +  soname_spec='${libname}${release}.so$major'
  6454.    shlibpath_var=LD_LIBRARY_PATH
  6455.    ;;
  6456.  
  6457. @@ -1214,31 +1889,53 @@
  6458.    dynamic_linker=no
  6459.    ;;
  6460.  esac
  6461. -echo "$ac_t$dynamic_linker"
  6462. +echo "$ac_t$dynamic_linker" 1>&6
  6463.  test "$dynamic_linker" = no && can_build_shared=no
  6464.  
  6465. -# FIXME add checks for striplib and old_striplib here.
  6466. -# strip -x works for most platforms, though not for static libraries on NetBSD
  6467. -# HP-UX requires "-r" for library stripping
  6468. -striplib=
  6469. -old_striplib=
  6470. -
  6471.  # Report the final consequences.
  6472.  echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6
  6473.  
  6474. +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then
  6475. +  case "$deplibs_check_method" in
  6476. +  "file_magic "*)
  6477. +    file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
  6478. +    if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
  6479. +       egrep "$file_magic_regex" > /dev/null; then
  6480. +      :
  6481. +    else
  6482. +      cat <<EOF 1>&2
  6483. +
  6484. +*** Warning: the command libtool uses to detect shared libraries,
  6485. +*** $file_magic_cmd, produces output that libtool cannot recognize.
  6486. +*** The result is that libtool may fail to recognize shared libraries
  6487. +*** as such.  This will affect the creation of libtool libraries that
  6488. +*** depend on shared libraries, but programs linked with such libtool
  6489. +*** libraries will work regardless of this problem.  Nevertheless, you
  6490. +*** may want to report the problem to your system manager and/or to
  6491. +*** bug-libtool@gnu.org
  6492. +
  6493. +EOF
  6494. +    fi ;;
  6495. +  esac
  6496. +fi
  6497. +
  6498.  echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6
  6499.  test "$can_build_shared" = "no" && enable_shared=no
  6500.  
  6501.  # On AIX, shared libraries and static libraries use the same namespace, and
  6502.  # are all built from PIC.
  6503.  case "$host_os" in
  6504. -aix*)
  6505. +aix3*)
  6506.    test "$enable_shared" = yes && enable_static=no
  6507.    if test -n "$RANLIB"; then
  6508. -    archive_cmds="$archive_cmds;\$RANLIB \$lib"
  6509. +    archive_cmds="$archive_cmds~\$RANLIB \$lib"
  6510.      postinstall_cmds='$RANLIB $lib'
  6511.    fi
  6512.    ;;
  6513. +
  6514. +aix4*)
  6515. +  test "$enable_shared" = yes && enable_static=no
  6516. +  ;;
  6517.  esac
  6518.  
  6519.  echo "$ac_t$enable_shared" 1>&6
  6520. @@ -1248,6 +1945,15 @@
  6521.  
  6522.  echo "checking whether to build static libraries... $enable_static" 1>&6
  6523.  
  6524. +if test "$hardcode_action" = relink; then
  6525. +  # Fast installation is not supported
  6526. +  enable_fast_install=no
  6527. +elif test "$shlibpath_overrides_runpath" = yes ||
  6528. +     test "$enable_shared" = no; then
  6529. +  # Fast installation is not necessary
  6530. +  enable_fast_install=needless
  6531. +fi
  6532. +
  6533.  echo $ac_n "checking for objdir... $ac_c" 1>&6
  6534.  rm -f .libs 2>/dev/null
  6535.  mkdir .libs 2>/dev/null
  6536. @@ -1260,155 +1966,717 @@
  6537.  rmdir .libs 2>/dev/null
  6538.  echo "$ac_t$objdir" 1>&6
  6539.  
  6540. +if test "x$enable_dlopen" != xyes; then
  6541. +  enable_dlopen=unknown
  6542. +  enable_dlopen_self=unknown
  6543. +  enable_dlopen_self_static=unknown
  6544. +else
  6545. +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then
  6546. +  lt_cv_dlopen=no lt_cv_dlopen_libs=
  6547. +echo $ac_n "checking for dlopen""... $ac_c" 1>&6
  6548. +echo "$progname:1977: checking for dlopen" >&5
  6549. +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
  6550. +  echo $ac_n "(cached) $ac_c" 1>&6
  6551. +else
  6552. +  cat > conftest.$ac_ext <<EOF
  6553. +#line 1982 "ltconfig"
  6554. +/* System header to define __stub macros and hopefully few prototypes,
  6555. +    which can conflict with char dlopen(); below.  */
  6556. +#include <assert.h>
  6557. +/* Override any gcc2 internal prototype to avoid an error.  */
  6558. +/* We use char because int might match the return type of a gcc2
  6559. +    builtin and then its argument prototype would still apply.  */
  6560. +char dlopen();
  6561. +
  6562. +int main() {
  6563. +
  6564. +/* The GNU C library defines this for functions which it implements
  6565. +    to always fail with ENOSYS.  Some functions are actually named
  6566. +    something starting with __ and the normal name is an alias.  */
  6567. +#if defined (__stub_dlopen) || defined (__stub___dlopen)
  6568. +choke me
  6569. +#else
  6570. +dlopen();
  6571. +#endif
  6572. +
  6573. +; return 0; }
  6574. +EOF
  6575. +if { (eval echo $progname:2004: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6576. +  rm -rf conftest*
  6577. +  eval "ac_cv_func_dlopen=yes"
  6578. +else
  6579. +  echo "$progname: failed program was:" >&5
  6580. +  cat conftest.$ac_ext >&5
  6581. +  rm -rf conftest*
  6582. +  eval "ac_cv_func_dlopen=no"
  6583. +fi
  6584. +rm -f conftest*
  6585. +fi
  6586. +
  6587. +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
  6588. +  echo "$ac_t""yes" 1>&6
  6589. +  lt_cv_dlopen="dlopen"
  6590. +else
  6591. +  echo "$ac_t""no" 1>&6
  6592. +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
  6593. +echo "$progname:2022: checking for dlopen in -ldl" >&5
  6594. +ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
  6595. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6596. +  echo $ac_n "(cached) $ac_c" 1>&6
  6597. +else
  6598. +  ac_save_LIBS="$LIBS"
  6599. +LIBS="-ldl  $LIBS"
  6600. +cat > conftest.$ac_ext <<EOF
  6601. +#line 2030 "ltconfig"
  6602. +/* Override any gcc2 internal prototype to avoid an error.  */
  6603. +/* We use char because int might match the return type of a gcc2
  6604. +    builtin and then its argument prototype would still apply.  */
  6605. +char dlopen();
  6606. +
  6607. +int main() {
  6608. +dlopen()
  6609. +; return 0; }
  6610. +EOF
  6611. +if { (eval echo $progname:2040: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6612. +  rm -rf conftest*
  6613. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6614. +else
  6615. +  echo "$progname: failed program was:" >&5
  6616. +  cat conftest.$ac_ext >&5
  6617. +  rm -rf conftest*
  6618. +  eval "ac_cv_lib_$ac_lib_var=no"
  6619. +fi
  6620. +rm -f conftest*
  6621. +LIBS="$ac_save_LIBS"
  6622. +
  6623. +fi
  6624. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6625. +  echo "$ac_t""yes" 1>&6
  6626. +  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
  6627. +else
  6628. +  echo "$ac_t""no" 1>&6
  6629. +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
  6630. +echo "$progname:2059: checking for dld_link in -ldld" >&5
  6631. +ac_lib_var=`echo dld'_'dld_link | sed 'y%./+-%__p_%'`
  6632. +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
  6633. +  echo $ac_n "(cached) $ac_c" 1>&6
  6634. +else
  6635. +  ac_save_LIBS="$LIBS"
  6636. +LIBS="-ldld  $LIBS"
  6637. +cat > conftest.$ac_ext <<EOF
  6638. +#line 2067 "ltconfig"
  6639. +/* Override any gcc2 internal prototype to avoid an error.  */
  6640. +/* We use char because int might match the return type of a gcc2
  6641. +    builtin and then its argument prototype would still apply.  */
  6642. +char dld_link();
  6643. +
  6644. +int main() {
  6645. +dld_link()
  6646. +; return 0; }
  6647. +EOF
  6648. +if { (eval echo $progname:2077: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6649. +  rm -rf conftest*
  6650. +  eval "ac_cv_lib_$ac_lib_var=yes"
  6651. +else
  6652. +  echo "$progname: failed program was:" >&5
  6653. +  cat conftest.$ac_ext >&5
  6654. +  rm -rf conftest*
  6655. +  eval "ac_cv_lib_$ac_lib_var=no"
  6656. +fi
  6657. +rm -f conftest*
  6658. +LIBS="$ac_save_LIBS"
  6659. +
  6660. +fi
  6661. +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
  6662. +  echo "$ac_t""yes" 1>&6
  6663. +  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
  6664. +else
  6665. +  echo "$ac_t""no" 1>&6
  6666. +echo $ac_n "checking for shl_load""... $ac_c" 1>&6
  6667. +echo "$progname:2096: checking for shl_load" >&5
  6668. +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then
  6669. +  echo $ac_n "(cached) $ac_c" 1>&6
  6670. +else
  6671. +  cat > conftest.$ac_ext <<EOF
  6672. +#line 2101 "ltconfig"
  6673. +/* System header to define __stub macros and hopefully few prototypes,
  6674. +    which can conflict with char shl_load(); below.  */
  6675. +#include <assert.h>
  6676. +/* Override any gcc2 internal prototype to avoid an error.  */
  6677. +/* We use char because int might match the return type of a gcc2
  6678. +    builtin and then its argument prototype would still apply.  */
  6679. +char shl_load();
  6680. +
  6681. +int main() {
  6682. +
  6683. +/* The GNU C library defines this for functions which it implements
  6684. +    to always fail with ENOSYS.  Some functions are actually named
  6685. +    something starting with __ and the normal name is an alias.  */
  6686. +#if defined (__stub_shl_load) || defined (__stub___shl_load)
  6687. +choke me
  6688. +#else
  6689. +shl_load();
  6690. +#endif
  6691. +
  6692. +; return 0; }
  6693. +EOF
  6694. +if { (eval echo $progname:2123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6695. +  rm -rf conftest*
  6696. +  eval "ac_cv_func_shl_load=yes"
  6697. +else
  6698. +  echo "$progname: failed program was:" >&5
  6699. +  cat conftest.$ac_ext >&5
  6700. +  rm -rf conftest*
  6701. +  eval "ac_cv_func_shl_load=no"
  6702. +fi
  6703. +rm -f conftest*
  6704. +fi
  6705. +
  6706. +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
  6707. +  echo "$ac_t""yes" 1>&6
  6708. +  lt_cv_dlopen="shl_load"
  6709. +else
  6710. +  echo "$ac_t""no" 1>&6
  6711. +echo $ac_n "checking for LoadLibrary""... $ac_c" 1>&6
  6712. +echo "$progname:2141: checking for LoadLibrary" >&5
  6713. +if eval "test \"`echo '$''{'ac_cv_func_LoadLibrary'+set}'`\" = set"; then
  6714. +  echo $ac_n "(cached) $ac_c" 1>&6
  6715. +else
  6716. +  cat > conftest.$ac_ext <<EOF
  6717. +#line 2146 "ltconfig"
  6718. +/* System header to define __stub macros and hopefully few prototypes,
  6719. +    which can conflict with char LoadLibrary(); below.  */
  6720. +#include <assert.h>
  6721. +/* Override any gcc2 internal prototype to avoid an error.  */
  6722. +/* We use char because int might match the return type of a gcc2
  6723. +    builtin and then its argument prototype would still apply.  */
  6724. +char LoadLibrary();
  6725. +
  6726. +int main() {
  6727. +
  6728. +/* The GNU C library defines this for functions which it implements
  6729. +    to always fail with ENOSYS.  Some functions are actually named
  6730. +    something starting with __ and the normal name is an alias.  */
  6731. +#if defined (__stub_LoadLibrary) || defined (__stub___LoadLibrary)
  6732. +choke me
  6733. +#else
  6734. +LoadLibrary();
  6735. +#endif
  6736. +
  6737. +; return 0; }
  6738. +EOF
  6739. +if { (eval echo $progname:2168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
  6740. +  rm -rf conftest*
  6741. +  eval "ac_cv_func_LoadLibrary=yes"
  6742. +else
  6743. +  echo "$progname: failed program was:" >&5
  6744. +  cat conftest.$ac_ext >&5
  6745. +  rm -rf conftest*
  6746. +  eval "ac_cv_func_LoadLibrary=no"
  6747. +fi
  6748. +rm -f conftest*
  6749. +fi
  6750. +
  6751. +if eval "test \"`echo '$ac_cv_func_'LoadLibrary`\" = yes"; then
  6752. +  echo "$ac_t""yes" 1>&6
  6753. +  lt_cv_dlopen="LoadLibrary"
  6754. +else
  6755. +  echo "$ac_t""no" 1>&6
  6756. +fi
  6757. +
  6758. +      
  6759. +fi
  6760. +
  6761. +    
  6762. +fi
  6763. +
  6764. +  
  6765. +fi
  6766. +
  6767. +
  6768. +fi
  6769. +
  6770. +fi
  6771. +
  6772. +  if test "x$lt_cv_dlopen" != xno; then
  6773. +    enable_dlopen=yes
  6774. +  fi
  6775. +
  6776. +  case "$lt_cv_dlopen" in
  6777. +  dlopen)
  6778. +for ac_hdr in dlfcn.h; do
  6779. +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
  6780. +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
  6781. +echo "$progname:2210: checking for $ac_hdr" >&5
  6782. +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
  6783. +  echo $ac_n "(cached) $ac_c" 1>&6
  6784. +else
  6785. +  cat > conftest.$ac_ext <<EOF
  6786. +#line 2215 "ltconfig"
  6787. +#include <$ac_hdr>
  6788. +int fnord = 0;
  6789. +EOF
  6790. +ac_try="$ac_compile conftest.$ac_ext >/dev/null 2>conftest.out"
  6791. +{ (eval echo $progname:2220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
  6792. +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
  6793. +if test -z "$ac_err"; then
  6794. +  rm -rf conftest*
  6795. +  eval "ac_cv_header_$ac_safe=yes"
  6796. +else
  6797. +  echo "$ac_err" >&5
  6798. +  echo "$progname: failed program was:" >&5
  6799. +  cat conftest.$ac_ext >&5
  6800. +  rm -rf conftest*
  6801. +  eval "ac_cv_header_$ac_safe=no"
  6802. +fi
  6803. +rm -f conftest*
  6804. +fi
  6805. +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
  6806. +  echo "$ac_t""yes" 1>&6
  6807. +else
  6808. +  echo "$ac_t""no" 1>&6
  6809. +fi
  6810. +done
  6811. +
  6812. +    if test "x$ac_cv_header_dlfcn_h" = xyes; then
  6813. +      CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
  6814. +    fi
  6815. +    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
  6816. +    LIBS="$lt_cv_dlopen_libs $LIBS"
  6817. +
  6818. +  echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6
  6819. +echo "$progname:2248: checking whether a program can dlopen itself" >&5
  6820. +if test "${lt_cv_dlopen_self+set}" = set; then
  6821. +  echo $ac_n "(cached) $ac_c" 1>&6
  6822. +else
  6823. +  if test "$cross_compiling" = yes; then
  6824. +    lt_cv_dlopen_self=cross
  6825. +  else
  6826. +    cat > conftest.c <<EOF
  6827. +#line 2256 "ltconfig"
  6828. +
  6829. +#if HAVE_DLFCN_H
  6830. +#include <dlfcn.h>
  6831. +#endif
  6832. +
  6833. +#include <stdio.h>
  6834. +
  6835. +#ifdef RTLD_GLOBAL
  6836. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6837. +#else
  6838. +# ifdef DL_GLOBAL
  6839. +#  define LTDL_GLOBAL    DL_GLOBAL
  6840. +# else
  6841. +#  define LTDL_GLOBAL    0
  6842. +# endif
  6843. +#endif
  6844. +
  6845. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6846. +   find out it does not work in some platform. */
  6847. +#ifndef LTDL_LAZY_OR_NOW
  6848. +# ifdef RTLD_LAZY
  6849. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6850. +# else
  6851. +#  ifdef DL_LAZY
  6852. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6853. +#  else
  6854. +#   ifdef RTLD_NOW
  6855. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6856. +#   else
  6857. +#    ifdef DL_NOW
  6858. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6859. +#    else
  6860. +#     define LTDL_LAZY_OR_NOW    0
  6861. +#    endif
  6862. +#   endif
  6863. +#  endif
  6864. +# endif
  6865. +#endif
  6866. +
  6867. +fnord() { int i=42;}
  6868. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6869. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6870. +           if(ptr1 || ptr2) exit(0); } exit(1); } 
  6871. +
  6872. +EOF
  6873. +if { (eval echo $progname:2302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6874. +then
  6875. +  lt_cv_dlopen_self=yes
  6876. +else
  6877. +  echo "$progname: failed program was:" >&5
  6878. +  cat conftest.$ac_ext >&5
  6879. +  rm -fr conftest*
  6880. +  lt_cv_dlopen_self=no
  6881. +fi
  6882. +rm -fr conftest*
  6883. +fi
  6884. +
  6885. +fi
  6886. +
  6887. +echo "$ac_t""$lt_cv_dlopen_self" 1>&6
  6888. +
  6889. +  if test "$lt_cv_dlopen_self" = yes; then
  6890. +    LDFLAGS="$LDFLAGS $link_static_flag"
  6891. +  echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6
  6892. +echo "$progname:2321: checking whether a statically linked program can dlopen itself" >&5
  6893. +if test "${lt_cv_dlopen_self_static+set}" = set; then
  6894. +  echo $ac_n "(cached) $ac_c" 1>&6
  6895. +else
  6896. +  if test "$cross_compiling" = yes; then
  6897. +    lt_cv_dlopen_self_static=cross
  6898. +  else
  6899. +    cat > conftest.c <<EOF
  6900. +#line 2329 "ltconfig"
  6901. +
  6902. +#if HAVE_DLFCN_H
  6903. +#include <dlfcn.h>
  6904. +#endif
  6905. +
  6906. +#include <stdio.h>
  6907. +
  6908. +#ifdef RTLD_GLOBAL
  6909. +# define LTDL_GLOBAL    RTLD_GLOBAL
  6910. +#else
  6911. +# ifdef DL_GLOBAL
  6912. +#  define LTDL_GLOBAL    DL_GLOBAL
  6913. +# else
  6914. +#  define LTDL_GLOBAL    0
  6915. +# endif
  6916. +#endif
  6917. +
  6918. +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
  6919. +   find out it does not work in some platform. */
  6920. +#ifndef LTDL_LAZY_OR_NOW
  6921. +# ifdef RTLD_LAZY
  6922. +#  define LTDL_LAZY_OR_NOW    RTLD_LAZY
  6923. +# else
  6924. +#  ifdef DL_LAZY
  6925. +#   define LTDL_LAZY_OR_NOW    DL_LAZY
  6926. +#  else
  6927. +#   ifdef RTLD_NOW
  6928. +#    define LTDL_LAZY_OR_NOW    RTLD_NOW
  6929. +#   else
  6930. +#    ifdef DL_NOW
  6931. +#     define LTDL_LAZY_OR_NOW    DL_NOW
  6932. +#    else
  6933. +#     define LTDL_LAZY_OR_NOW    0
  6934. +#    endif
  6935. +#   endif
  6936. +#  endif
  6937. +# endif
  6938. +#endif
  6939. +
  6940. +fnord() { int i=42;}
  6941. +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW);
  6942. +    if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord");
  6943. +    if(ptr1 || ptr2) exit(0); } exit(1); } 
  6944. +
  6945. +EOF
  6946. +if { (eval echo $progname:2375: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
  6947. +then
  6948. +  lt_cv_dlopen_self_static=yes
  6949. +else
  6950. +  echo "$progname: failed program was:" >&5
  6951. +  cat conftest.$ac_ext >&5
  6952. +  rm -fr conftest*
  6953. +  lt_cv_dlopen_self_static=no
  6954. +fi
  6955. +rm -fr conftest*
  6956. +fi
  6957. +
  6958. +fi
  6959. +
  6960. +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6
  6961. +fi
  6962. +    ;;
  6963. +  esac
  6964. +
  6965. +  case "$lt_cv_dlopen_self" in
  6966. +  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
  6967. +  *) enable_dlopen_self=unknown ;;
  6968. +  esac
  6969. +
  6970. +  case "$lt_cv_dlopen_self_static" in
  6971. +  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
  6972. +  *) enable_dlopen_self_static=unknown ;;
  6973. +  esac
  6974. +fi
  6975. +
  6976.  # Copy echo and quote the copy, instead of the original, because it is
  6977.  # used later.
  6978.  ltecho="$echo"
  6979. +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then
  6980. +   ltecho="$CONFIG_SHELL \$0 --fallback-echo"
  6981. +fi
  6982. +LTSHELL="$SHELL"
  6983.  
  6984. -# Now quote all the things that may contain metacharacters.
  6985. -for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  6986. -  old_LN_S AR CC LD LN_S NM reload_flag reload_cmds wl pic_flag \
  6987. -  link_static_flag no_builtin_flag export_dynamic_flag_spec \
  6988. -  profile_flag_pattern libname_spec library_names_spec soname_spec RANLIB \
  6989. -  old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  6990. -  old_postuninstall_cmds archive_cmds postinstall_cmds postuninstall_cmds \
  6991. -  allow_undefined_flag finish_cmds finish_eval global_symbol_pipe \
  6992. -  striplib old_striplib \
  6993. -  hardcode_libdir_flag_spec hardcode_libdir_separator; do
  6994. -
  6995. -  case "$var" in
  6996. -  reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  6997. -  old_postinstall_cmds | old_postuninstall_cmds | archive_cmds | \
  6998. -  postinstall_cmds | postuninstall_cmds | finish_cmds)
  6999. -    # Double-quote double-evaled strings.
  7000. -    eval "$var=\`\$echo \"\$$var\" | sed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\"\`"
  7001. -    ;;
  7002. -  *)
  7003. -    eval "$var=\`\$echo \"\$$var\" | sed \"\$sed_quote_subst\"\`"
  7004. +LTCONFIG_VERSION="$VERSION"
  7005. +
  7006. +# Only quote variables if we're using ltmain.sh.
  7007. +case "$ltmain" in
  7008. +*.sh)
  7009. +  # Now quote all the things that may contain metacharacters.
  7010. +  for var in ltecho old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  7011. +    old_LN_S old_DLLTOOL old_AS AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \
  7012. +    reload_flag reload_cmds wl \
  7013. +    pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
  7014. +    thread_safe_flag_spec whole_archive_flag_spec libname_spec \
  7015. +    library_names_spec soname_spec \
  7016. +    RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
  7017. +    old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \
  7018. +    file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \
  7019. +    finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
  7020. +    hardcode_libdir_flag_spec hardcode_libdir_separator  \
  7021. +    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
  7022. +    compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
  7023. +
  7024. +    case "$var" in
  7025. +    reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \
  7026. +    old_postinstall_cmds | old_postuninstall_cmds | \
  7027. +    export_symbols_cmds | archive_cmds | archive_expsym_cmds | \
  7028. +    postinstall_cmds | postuninstall_cmds | \
  7029. +    finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
  7030. +      # Double-quote double-evaled strings.
  7031. +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
  7032. +      ;;
  7033. +    *)
  7034. +      eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
  7035. +      ;;
  7036. +    esac
  7037. +  done
  7038. +
  7039. +  case "$ltecho" in
  7040. +  *'\$0 --fallback-echo"')
  7041. +    ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
  7042.      ;;
  7043.    esac
  7044. -done
  7045.  
  7046. -ofile=libtool
  7047. -trap "$rm $ofile; exit 1" 1 2 15
  7048. -echo creating $ofile
  7049. -$rm $ofile
  7050. -cat <<EOF > $ofile
  7051. -#! /bin/sh
  7052. -
  7053. -# libtool - Provide generalized library-building support services.
  7054. +  trap "$rm \"$ofile\"; exit 1" 1 2 15
  7055. +  echo "creating $ofile"
  7056. +  $rm "$ofile"
  7057. +  cat <<EOF > "$ofile"
  7058. +#! $SHELL
  7059. +
  7060. +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
  7061. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  7062. +# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
  7063. +#
  7064. +# Copyright (C) 1996-1999 Free Software Foundation, Inc.
  7065. +# Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  7066. +#
  7067. +# This program is free software; you can redistribute it and/or modify
  7068. +# it under the terms of the GNU General Public License as published by
  7069. +# the Free Software Foundation; either version 2 of the License, or
  7070. +# (at your option) any later version.
  7071. +#
  7072. +# This program is distributed in the hope that it will be useful, but
  7073. +# WITHOUT ANY WARRANTY; without even the implied warranty of
  7074. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  7075. +# General Public License for more details.
  7076.  #
  7077. -# Generated automatically by $PROGRAM - GNU $PACKAGE $VERSION
  7078. -# This program was configured as follows,
  7079. -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  7080. +# You should have received a copy of the GNU General Public License
  7081. +# along with this program; if not, write to the Free Software
  7082. +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  7083.  #
  7084. -# CC="$old_CC" CFLAGS="$old_CFLAGS" CPPFLAGS="$old_CPPFLAGS" \\
  7085. -# LD="$old_LD" NM="$old_NM" RANLIB="$old_RANLIB" LN_S="$old_LN_S" \\
  7086. +# As a special exception to the GNU General Public License, if you
  7087. +# distribute this file as part of a program that contains a
  7088. +# configuration script generated by Autoconf, you may include it under
  7089. +# the same distribution terms that you use for the rest of that program.
  7090. +
  7091. +# Sed that helps us avoid accidentally triggering echo(1) options like -n.
  7092. +Xsed="sed -e s/^X//"
  7093. +
  7094. +# The HP-UX ksh and POSIX shell print the target directory to stdout
  7095. +# if CDPATH is set.
  7096. +if test "\${CDPATH+set}" = set; then CDPATH=; export CDPATH; fi
  7097. +
  7098. +### BEGIN LIBTOOL CONFIG
  7099. +EOF
  7100. +  cfgfile="$ofile"
  7101. +  ;;
  7102. +
  7103. +*)
  7104. +  # Double-quote the variables that need it (for aesthetics).
  7105. +  for var in old_CC old_CFLAGS old_CPPFLAGS old_LD old_NM old_RANLIB \
  7106. +    old_LN_S old_DLLTOOL old_AS; do
  7107. +    eval "$var=\\\"\$var\\\""
  7108. +  done
  7109. +
  7110. +  # Just create a config file.
  7111. +  cfgfile="$ofile.cfg"
  7112. +  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
  7113. +  echo "creating $cfgfile"
  7114. +  $rm "$cfgfile"
  7115. +  cat <<EOF > "$cfgfile"
  7116. +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file.
  7117. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
  7118. +EOF
  7119. +  ;;
  7120. +esac
  7121. +
  7122. +cat <<EOF >> "$cfgfile"
  7123. +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  7124. +#
  7125. +# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\
  7126. +# LD=$old_LD NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\
  7127. +# DLLTOOL="$old_DLLTOOL" AS="$old_AS" \\
  7128.  #   $0$ltconfig_args
  7129.  #
  7130.  # Compiler and other test output produced by $progname, useful for
  7131.  # debugging $progname, is in ./config.log if it exists.
  7132.  
  7133. -# An echo program that doesn't interpret backslashes.
  7134. -echo="$ltecho"
  7135. -
  7136.  # The version of $progname that generated this script.
  7137. -LTCONFIG_VERSION="$VERSION"
  7138. +LTCONFIG_VERSION=$LTCONFIG_VERSION
  7139.  
  7140.  # Shell to use when invoking shell scripts.
  7141. -SHELL=${CONFIG_SHELL-/bin/sh}
  7142. +SHELL=$LTSHELL
  7143.  
  7144. -# Whether or not to build libtool libraries.
  7145. +# Whether or not to build shared libraries.
  7146.  build_libtool_libs=$enable_shared
  7147.  
  7148. -# Whether or not to build old-style libraries.
  7149. +# Whether or not to build static libraries.
  7150.  build_old_libs=$enable_static
  7151.  
  7152. +# Whether or not to optimize for fast installation.
  7153. +fast_install=$enable_fast_install
  7154. +
  7155.  # The host system.
  7156. -host_alias="$host_alias"
  7157. -host="$host"
  7158. +host_alias=$host_alias
  7159. +host=$host
  7160. +
  7161. +# An echo program that does not interpret backslashes.
  7162. +echo=$ltecho
  7163.  
  7164.  # The archiver.
  7165. -AR="$AR"
  7166. +AR=$AR
  7167.  
  7168.  # The default C compiler.
  7169. -CC="$CC"
  7170. +CC=$CC
  7171.  
  7172.  # The linker used to build libraries.
  7173. -LD="$LD"
  7174. +LD=$LD
  7175.  
  7176.  # Whether we need hard or soft links.
  7177. -LN_S="$LN_S"
  7178. +LN_S=$LN_S
  7179.  
  7180.  # A BSD-compatible nm program.
  7181. -NM="$NM"
  7182. +NM=$NM
  7183. +
  7184. +# Used on cygwin: DLL creation program.
  7185. +DLLTOOL="$DLLTOOL"
  7186. +
  7187. +# Used on cygwin: assembler.
  7188. +AS="$AS"
  7189.  
  7190.  # The name of the directory that contains temporary libtool files.
  7191. -objdir="$objdir"
  7192. +objdir=$objdir
  7193.  
  7194.  # How to create reloadable object files.
  7195. -reload_flag="$reload_flag"
  7196. -reload_cmds="$reload_cmds"
  7197. +reload_flag=$reload_flag
  7198. +reload_cmds=$reload_cmds
  7199.  
  7200.  # How to pass a linker flag through the compiler.
  7201. -wl="$wl"
  7202. +wl=$wl
  7203. +
  7204. +# Object file suffix (normally "o").
  7205. +objext="$objext"
  7206. +
  7207. +# Old archive suffix (normally "a").
  7208. +libext="$libext"
  7209.  
  7210.  # Additional compiler flags for building library objects.
  7211. -pic_flag="$pic_flag"
  7212. +pic_flag=$pic_flag
  7213. +
  7214. +# Does compiler simultaneously support -c and -o options
  7215. +compiler_c_o=$compiler_c_o
  7216. +
  7217. +# Can we write directly to a .lo ?
  7218. +compiler_o_lo=$compiler_o_lo
  7219. +
  7220. +# Must we lock files when doing compilation ?
  7221. +need_locks=$need_locks
  7222. +
  7223. +# Do we need the lib prefix for modules?
  7224. +need_lib_prefix=$need_lib_prefix
  7225. +
  7226. +# Do we need a version for libraries?
  7227. +need_version=$need_version
  7228. +
  7229. +# Whether dlopen is supported.
  7230. +dlopen=$enable_dlopen
  7231. +
  7232. +# Whether dlopen of programs is supported.
  7233. +dlopen_self=$enable_dlopen_self
  7234. +
  7235. +# Whether dlopen of statically linked programs is supported.
  7236. +dlopen_self_static=$enable_dlopen_self_static
  7237.  
  7238.  # Compiler flag to prevent dynamic linking.
  7239. -link_static_flag="$link_static_flag"
  7240. +link_static_flag=$link_static_flag
  7241.  
  7242.  # Compiler flag to turn off builtin functions.
  7243. -no_builtin_flag="$no_builtin_flag"
  7244. +no_builtin_flag=$no_builtin_flag
  7245.  
  7246.  # Compiler flag to allow reflexive dlopens.
  7247. -export_dynamic_flag_spec="$export_dynamic_flag_spec"
  7248. +export_dynamic_flag_spec=$export_dynamic_flag_spec
  7249. +
  7250. +# Compiler flag to generate shared objects directly from archives.
  7251. +whole_archive_flag_spec=$whole_archive_flag_spec
  7252.  
  7253. -# Pattern to match compiler flags for creating libNAME_p libraries:
  7254. -profile_flag_pattern="$profile_flag_pattern"
  7255. +# Compiler flag to generate thread-safe objects.
  7256. +thread_safe_flag_spec=$thread_safe_flag_spec
  7257.  
  7258.  # Library versioning type.
  7259.  version_type=$version_type
  7260.  
  7261.  # Format of library name prefix.
  7262. -libname_spec="$libname_spec"
  7263. +libname_spec=$libname_spec
  7264.  
  7265.  # List of archive names.  First name is the real one, the rest are links.
  7266.  # The last name is the one that the linker finds with -lNAME.
  7267. -library_names_spec="$library_names_spec"
  7268. +library_names_spec=$library_names_spec
  7269.  
  7270.  # The coded name of the library, if different from the real name.
  7271. -soname_spec="$soname_spec"
  7272. +soname_spec=$soname_spec
  7273.  
  7274.  # Commands used to build and install an old-style archive.
  7275. -RANLIB="$RANLIB"
  7276. -old_archive_cmds="$old_archive_cmds"
  7277. -old_postinstall_cmds="$old_postinstall_cmds"
  7278. -old_postuninstall_cmds="$old_postuninstall_cmds"
  7279. +RANLIB=$RANLIB
  7280. +old_archive_cmds=$old_archive_cmds
  7281. +old_postinstall_cmds=$old_postinstall_cmds
  7282. +old_postuninstall_cmds=$old_postuninstall_cmds
  7283.  
  7284.  # Create an old-style archive from a shared archive.
  7285. -old_archive_from_new_cmds="$old_archive_from_new_cmds"
  7286. +old_archive_from_new_cmds=$old_archive_from_new_cmds
  7287.  
  7288.  # Commands used to build and install a shared archive.
  7289. -archive_cmds="$archive_cmds"
  7290. -postinstall_cmds="$postinstall_cmds"
  7291. -postuninstall_cmds="$postuninstall_cmds"
  7292. +archive_cmds=$archive_cmds
  7293. +archive_expsym_cmds=$archive_expsym_cmds
  7294. +postinstall_cmds=$postinstall_cmds
  7295. +postuninstall_cmds=$postuninstall_cmds
  7296. +
  7297. +# Method to check whether dependent libraries are shared objects.
  7298. +deplibs_check_method=$deplibs_check_method
  7299. +
  7300. +# Command to use when deplibs_check_method == file_magic
  7301. +file_magic_cmd=$file_magic_cmd
  7302.  
  7303.  # Flag that allows shared libraries with undefined symbols to be built.
  7304. -allow_undefined_flag="$allow_undefined_flag"
  7305. +allow_undefined_flag=$allow_undefined_flag
  7306. +
  7307. +# Flag that forces no undefined symbols.
  7308. +no_undefined_flag=$no_undefined_flag
  7309.  
  7310.  # Commands used to finish a libtool library installation in a directory.
  7311. -finish_cmds="$finish_cmds"
  7312. +finish_cmds=$finish_cmds
  7313.  
  7314.  # Same as above, but a single script fragment to be evaled but not shown.
  7315. -finish_eval="$finish_eval"
  7316. +finish_eval=$finish_eval
  7317.  
  7318.  # Take the output of nm and produce a listing of raw symbols and C names.
  7319. -global_symbol_pipe="$global_symbol_pipe"
  7320. +global_symbol_pipe=$global_symbol_pipe
  7321.  
  7322. -# How to strip a library file.
  7323. -striplib="$striplib"
  7324. -old_striplib="$old_striplib"
  7325. +# Transform the output of nm in a proper C declaration
  7326. +global_symbol_to_cdecl=$global_symbol_to_cdecl
  7327.  
  7328.  # This is the shared library runtime path variable.
  7329.  runpath_var=$runpath_var
  7330. @@ -1416,15 +2684,18 @@
  7331.  # This is the shared library path variable.
  7332.  shlibpath_var=$shlibpath_var
  7333.  
  7334. +# Is shlibpath searched before the hard-coded library search path?
  7335. +shlibpath_overrides_runpath=$shlibpath_overrides_runpath
  7336. +
  7337.  # How to hardcode a shared library path into an executable.
  7338.  hardcode_action=$hardcode_action
  7339.  
  7340.  # Flag to hardcode \$libdir into a binary during linking.
  7341.  # This must work even if \$libdir does not exist.
  7342. -hardcode_libdir_flag_spec="$hardcode_libdir_flag_spec"
  7343. +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec
  7344.  
  7345.  # Whether we need a single -rpath flag with a separated argument.
  7346. -hardcode_libdir_separator="$hardcode_libdir_separator"
  7347. +hardcode_libdir_separator=$hardcode_libdir_separator
  7348.  
  7349.  # Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
  7350.  # resulting binary.
  7351. @@ -1434,19 +2705,41 @@
  7352.  # resulting binary.
  7353.  hardcode_minus_L=$hardcode_minus_L
  7354.  
  7355. -# Set to yes if using RUNPATH_VAR=DIR during linking hardcodes DIR into the
  7356. -# resulting binary.
  7357. -hardcode_runpath_var=$hardcode_runpath_var
  7358. -
  7359.  # Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
  7360.  # the resulting binary.
  7361.  hardcode_shlibpath_var=$hardcode_shlibpath_var
  7362.  
  7363. +# Compile-time system search path for libraries
  7364. +sys_lib_search_path_spec=$sys_lib_search_path_spec
  7365. +
  7366. +# Run-time system search path for libraries
  7367. +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec
  7368. +
  7369. +# Fix the shell variable \$srcfile for the compiler.
  7370. +fix_srcfile_path="$fix_srcfile_path"
  7371. +
  7372. +# Set to yes if exported symbols are required
  7373. +always_export_symbols=$always_export_symbols
  7374. +
  7375. +# The command to extract exported symbols
  7376. +export_symbols_cmds=$export_symbols_cmds
  7377. +
  7378. +# Symbols that should not be listed in the preloaded symbols
  7379. +exclude_expsyms=$exclude_expsyms
  7380. +
  7381. +# Symbols that must always be exported
  7382. +include_expsyms=$include_expsyms
  7383. +
  7384.  EOF
  7385.  
  7386. -case "$host_os" in
  7387. -aix*)
  7388. -  cat <<\EOF >> $ofile
  7389. +case "$ltmain" in
  7390. +*.sh)
  7391. +  echo '### END LIBTOOL CONFIG' >> "$ofile"
  7392. +  echo >> "$ofile"
  7393. +  case "$host_os" in
  7394. +  aix3*)
  7395. +    cat <<\EOF >> "$ofile"
  7396. +
  7397.  # AIX sometimes has problems with the GCC collect2 program.  For some
  7398.  # reason, if we set the COLLECT_NAMES environment variable, the problems
  7399.  # vanish in a puff of smoke.
  7400. @@ -1454,32 +2747,73 @@
  7401.    COLLECT_NAMES=
  7402.    export COLLECT_NAMES
  7403.  fi
  7404. -
  7405.  EOF
  7406. -  ;;
  7407. -esac
  7408. +    ;;
  7409. +  esac
  7410.  
  7411. -# Detect if we are using a relative or absolute path to ltmain.sh.
  7412. -case "$ltmain" in
  7413. -/*) cat <<EOF >> $ofile
  7414. -# Execute the libtool backend.
  7415. -. $ltmain
  7416. -EOF
  7417. +  # Append the ltmain.sh script.
  7418. +  cat "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1)
  7419. +
  7420. +  chmod +x "$ofile"
  7421.    ;;
  7422. -*) cat <<EOF >> $ofile
  7423. -# Find the path to this script.
  7424. -thisdir=\`$echo "\$0" | sed -e 's%/[^/]*\$%%'\`
  7425. -test "X\$0" = "X\$thisdir" && thisdir=.
  7426.  
  7427. -# Execute the libtool backend.
  7428. -. \$thisdir/$ltmain
  7429. -EOF
  7430. +*)
  7431. +  # Compile the libtool program.
  7432. +  echo "FIXME: would compile $ltmain"
  7433.    ;;
  7434.  esac
  7435.  
  7436. -echo 'exit 1' >> $ofile
  7437. +test -n "$cache_file" || exit 0
  7438. +
  7439. +# AC_CACHE_SAVE
  7440. +trap '' 1 2 15
  7441. +cat > confcache <<\EOF
  7442. +# This file is a shell script that caches the results of configure
  7443. +# tests run on this system so they can be shared between configure
  7444. +# scripts and configure runs.  It is not useful on other systems.
  7445. +# If it contains results you don't want to keep, you may remove or edit it.
  7446. +#
  7447. +# By default, configure uses ./config.cache as the cache file,
  7448. +# creating it if it does not exist already.  You can give configure
  7449. +# the --cache-file=FILE option to use a different cache file; that is
  7450. +# what configure does when it calls configure scripts in
  7451. +# subdirectories, so they share the cache.
  7452. +# Giving --cache-file=/dev/null disables caching, for debugging configure.
  7453. +# config.status only pays attention to the cache file if you give it the
  7454. +# --recheck option to rerun configure.
  7455. +#
  7456. +EOF
  7457. +# The following way of writing the cache mishandles newlines in values,
  7458. +# but we know of no workaround that is simple, portable, and efficient.
  7459. +# So, don't put newlines in cache variables' values.
  7460. +# Ultrix sh set writes to stderr and can't be redirected directly,
  7461. +# and sets the high bit in the cache file unless we assign to the vars.
  7462. +(set) 2>&1 |
  7463. +  case `(ac_space=' '; set | grep ac_space) 2>&1` in
  7464. +  *ac_space=\ *)
  7465. +    # `set' does not quote correctly, so add quotes (double-quote substitution
  7466. +    # turns \\\\ into \\, and sed turns \\ into \).
  7467. +    sed -n \
  7468. +      -e "s/'/'\\\\''/g" \
  7469. +      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
  7470. +    ;;
  7471. +  *)
  7472. +    # `set' quotes correctly as required by POSIX, so do not add quotes.
  7473. +    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
  7474. +    ;;
  7475. +  esac >> confcache
  7476. +if cmp -s $cache_file confcache; then
  7477. +  :
  7478. +else
  7479. +  if test -w $cache_file; then
  7480. +    echo "updating cache $cache_file"
  7481. +    cat confcache > $cache_file
  7482. +  else
  7483. +    echo "not updating unwritable cache $cache_file"
  7484. +  fi
  7485. +fi
  7486. +rm -f confcache
  7487.  
  7488. -chmod +x $ofile
  7489.  exit 0
  7490.  
  7491.  # Local Variables:
  7492.